SOURCE

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
    <title>死亡万花筒 · 沉浸式剧本杀</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        body {
            background: #0a0808;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 12px;
            background-image: 
                radial-gradient(ellipse at 20% 50%, #1a0f15 0%, #0a0808 70%),
                repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px);
        }

        .game-container {
            max-width: 520px;
            width: 100%;
            background: rgba(16, 12, 18, 0.92);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 32px 32px 24px 24px;
            padding: 20px 18px 28px;
            box-shadow: 
                0 0 60px rgba(120, 40, 80, 0.15),
                0 0 0 1px #4a2a3a inset,
                0 0 0 2px #1f121a inset;
            border: 1px solid #6a3a5a;
            position: relative;
        }

        .game-container::before {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 34px;
            padding: 2px;
            background: linear-gradient(135deg, #8a4a7a, #3a1a2a, #8a4a7a);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
        }

        /* ===== 顶部 ===== */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            flex-wrap: wrap;
            gap: 6px;
        }

        .title-main {
            font-size: 1.6rem;
            font-weight: 700;
            background: linear-gradient(135deg, #f0c8e0, #d080b0, #f0c8e0);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 3px;
            text-shadow: none;
        }

        .title-sub {
            font-size: 0.65rem;
            color: #a07090;
            background: #1a1018;
            padding: 2px 14px;
            border-radius: 20px;
            border: 1px solid #5a3a4a;
            letter-spacing: 1px;
        }

        /* ===== 状态栏 ===== */
        .status-bar {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 4px;
            background: #100a10;
            border-radius: 16px;
            padding: 6px 8px;
            border: 1px solid #3a2230;
            margin-bottom: 14px;
        }

        .stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 4px 2px;
            border-radius: 10px;
            background: rgba(30, 18, 26, 0.6);
        }

        .stat-label {
            font-size: 0.5rem;
            color: #806070;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .stat-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: #f0d8e8;
            text-shadow: 0 0 12px rgba(200, 100, 160, 0.3);
        }

        .stat-value.shard { color: #f0a0c0; }
        .stat-value.door { color: #a0c0f0; }
        .stat-value.memory { color: #c0f0a0; }
        .stat-value.health { color: #f08080; }

        /* ===== 场景区域 ===== */
        .scene-area {
            background: #0d080e;
            border-radius: 20px;
            padding: 18px 16px;
            min-height: 180px;
            border: 1px solid #3a2230;
            box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
            margin-bottom: 14px;
            position: relative;
        }

        .scene-location {
            font-size: 0.65rem;
            color: #806080;
            letter-spacing: 2px;
            border-bottom: 1px dashed #2a1a22;
            padding-bottom: 6px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
        }

        .scene-text {
            font-size: 0.95rem;
            line-height: 1.9;
            color: #e8d0e0;
            text-shadow: 0 0 8px rgba(60, 20, 40, 0.5);
            min-height: 80px;
        }

        .scene-text .highlight {
            color: #f0a0c0;
            font-weight: 600;
            background: rgba(80, 30, 60, 0.4);
            padding: 0 6px;
            border-radius: 4px;
            border-left: 2px solid #c080b0;
        }

        .scene-text .danger {
            color: #f06060;
            font-weight: 600;
            background: rgba(80, 20, 20, 0.4);
            padding: 0 6px;
            border-radius: 4px;
        }

        .scene-text .npc {
            color: #80d0f0;
            font-weight: 600;
        }

        .scene-text .item {
            color: #f0d080;
            font-weight: 600;
        }

        .scene-text i {
            color: #b090b0;
            font-style: italic;
        }

        /* ===== 背包系统 ===== */
        .inventory-section {
            background: #0d080e;
            border-radius: 14px;
            padding: 10px 14px;
            border: 1px solid #2a1a22;
            margin-bottom: 14px;
        }

        .inventory-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.7rem;
            color: #806080;
            letter-spacing: 1px;
            margin-bottom: 6px;
        }

        .inventory-items {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            min-height: 28px;
        }

        .inv-item {
            background: #1a101a;
            border: 1px solid #4a2a3a;
            border-radius: 12px;
            padding: 2px 12px;
            font-size: 0.75rem;
            color: #f0d080;
            display: flex;
            align-items: center;
            gap: 4px;
            animation: itemAppear 0.3s ease;
        }

        @keyframes itemAppear {
            from { transform: scale(0.8); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        .inv-item .item-icon {
            font-size: 0.9rem;
        }

        .empty-inv {
            color: #503040;
            font-size: 0.7rem;
            font-style: italic;
        }

        /* ===== 选项 ===== */
        .choices {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 4px;
        }

        .choice-btn {
            background: linear-gradient(145deg, #1a101a, #100a10);
            border: 1px solid #3a2230;
            border-radius: 16px;
            padding: 12px 16px;
            color: #dcc0d0;
            font-size: 0.9rem;
            text-align: left;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all 0.2s ease;
            cursor: pointer;
            touch-action: manipulation;
            box-shadow: 0 2px 0 #1a0a12;
        }

        .choice-btn:active {
            transform: scale(0.97);
            background: #2a1822;
            border-color: #7a4a6a;
            box-shadow: 0 0 24px rgba(160, 80, 120, 0.2);
        }

        .choice-btn .choice-letter {
            background: #2a1a22;
            border-radius: 50%;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            color: #c090b0;
            border: 1px solid #4a2a3a;
            flex-shrink: 0;
        }

        .choice-btn .choice-desc {
            flex: 1;
        }

        .choice-btn .choice-hint {
            font-size: 0.6rem;
            color: #705060;
            display: block;
            margin-top: 2px;
        }

        .choice-btn.required-item {
            border-color: #d0a060;
            background: linear-gradient(145deg, #1a1210, #100a0a);
        }

        .choice-btn.required-item .choice-letter {
            border-color: #d0a060;
            color: #f0d080;
        }

        /* ===== 底部按钮 ===== */
        .bottom-bar {
            display: flex;
            gap: 10px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        .bottom-btn {
            flex: 1;
            min-width: 80px;
            background: #1a101a;
            border: 1px solid #3a2230;
            border-radius: 14px;
            padding: 10px 12px;
            color: #b090a0;
            font-size: 0.8rem;
            text-align: center;
            transition: all 0.15s;
            cursor: pointer;
            touch-action: manipulation;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .bottom-btn:active {
            transform: scale(0.95);
            background: #2a1822;
            border-color: #6a4a5a;
        }

        .bottom-btn.share-btn {
            border-color: #5a3a6a;
            background: #1a1020;
        }

        .bottom-btn .icon {
            font-size: 1rem;
        }

        /* ===== 通知/提示 ===== */
        .notification {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(10, 6, 10, 0.95);
            border: 1px solid #6a3a5a;
            border-radius: 16px;
            padding: 12px 24px;
            color: #f0d8e8;
            font-size: 0.9rem;
            max-width: 400px;
            width: 90%;
            text-align: center;
            z-index: 100;
            box-shadow: 0 0 60px rgba(80, 20, 60, 0.4);
            animation: slideDown 0.4s ease;
            pointer-events: none;
        }

        @keyframes slideDown {
            from { top: -60px; opacity: 0; }
            to { top: 20px; opacity: 1; }
        }

        /* ===== 适配 ===== */
        @media (max-width: 400px) {
            .game-container { padding: 14px 12px 20px; }
            .title-main { font-size: 1.3rem; }
            .status-bar { grid-template-columns: 1fr 1fr; gap: 4px; }
            .scene-text { font-size: 0.85rem; }
            .choice-btn { padding: 10px 12px; font-size: 0.8rem; }
        }
    </style>
</head>
<body>

<div class="game-container" id="app">
    <!-- 顶栏 -->
    <div class="header">
        <span class="title-main">✦ 死亡万花筒 ✦</span>
        <span class="title-sub">剧本杀 · 沉浸版</span>
    </div>

    <!-- 状态 -->
    <div class="status-bar">
        <div class="stat-item"><span class="stat-label">◆ 碎片</span><span class="stat-value shard" id="shardDisplay">0</span></div>
        <div class="stat-item"><span class="stat-label">◈ 门</span><span class="stat-value door" id="doorDisplay">1</span></div>
        <div class="stat-item"><span class="stat-label">✧ 记忆</span><span class="stat-value memory" id="memoryDisplay">0</span></div>
        <div class="stat-item"><span class="stat-label">❤ 理智</span><span class="stat-value health" id="healthDisplay">100</span></div>
    </div>

    <!-- 场景 -->
    <div class="scene-area">
        <div class="scene-location">
            <span id="locationDisplay">�� 万花筒起点</span>
            <span id="doorCounter">�� 第 1 / 14 扇门</span>
        </div>
        <div class="scene-text" id="sceneText">
            <span class="highlight">「门」</span> 在你面前缓缓开启……<br>
            你准备好进入 <i>死亡万花筒</i> 了吗?
        </div>
    </div>

    <!-- 背包 -->
    <div class="inventory-section">
        <div class="inventory-header">
            <span>�� 背包</span>
            <span id="invCount">0 件</span>
        </div>
        <div class="inventory-items" id="inventoryContainer">
            <span class="empty-inv">空</span>
        </div>
    </div>

    <!-- 选项 -->
    <div class="choices" id="choiceContainer"></div>

    <!-- 底部 -->
    <div class="bottom-bar">
        <div class="bottom-btn" id="resetBtn"><span class="icon">⟳</span> 重启</div>
        <div class="bottom-btn share-btn" id="shareBtn"><span class="icon">✤</span> 分享</div>
        <div class="bottom-btn" id="hintBtn"><span class="icon">��</span> 提示</div>
    </div>
</div>

<script>
(function() {
    // ================================================================
    //  沉浸式剧本杀 · 完整剧情引擎
    //  包含:道具系统、NPC交互、多种路线、理智值、结局分支
    // ================================================================

    // ---------- 游戏状态 ----------
    let state = {
        currentId: 'start',
        shards: 0,
        doors: 1,
        memories: 0,
        health: 100,
        inventory: [],
        flags: {},
        visited: [],
        choices: []
    };

    // ---------- 工具函数 ----------
    function addItem(item) {
        if (!state.inventory.includes(item)) {
            state.inventory.push(item);
            showNotification(`�� 获得道具:${item}`);
            return true;
        }
        return false;
    }

    function hasItem(item) {
        return state.inventory.includes(item);
    }

    function removeItem(item) {
        const idx = state.inventory.indexOf(item);
        if (idx > -1) {
            state.inventory.splice(idx, 1);
            return true;
        }
        return false;
    }

    function setFlag(flag) {
        state.flags[flag] = true;
    }

    function hasFlag(flag) {
        return !!state.flags[flag];
    }

    function adjustHealth(delta) {
        state.health = Math.max(0, Math.min(100, state.health + delta));
        if (delta < 0) {
            showNotification(`�� 理智 -${Math.abs(delta)}`);
        } else if (delta > 0) {
            showNotification(`�� 理智 +${delta}`);
        }
        if (state.health <= 0) {
            showNotification('�� 你的理智已崩溃…… 门将你吞噬。');
            setTimeout(() => resetGame(), 1500);
        }
        updateUI();
    }

    // ---------- 通知系统 ----------
    let notifTimer = null;

    function showNotification(text) {
        const old = document.querySelector('.notification');
        if (old) old.remove();
        if (notifTimer) clearTimeout(notifTimer);

        const div = document.createElement('div');
        div.className = 'notification';
        div.textContent = text;
        document.body.appendChild(div);

        notifTimer = setTimeout(() => {
            if (div.parentNode) div.remove();
        }, 2800);
    }

    // ---------- 剧情节点(高配版) ----------
    const story = {

        // ========== 起点 ==========
        start: {
            id: 'start',
            location: '�� 万花筒起点',
            door: 0,
            text: `你站在一片虚无之中,面前漂浮着 <span class="highlight">十四扇门</span> 。<br>
            每一扇门后,都是一个完整的 <span class="npc">剧本</span> 。<br>
            <i>“推开哪一扇,由你决定。”</i><br><br>
            �� 你感觉有人在你耳边低语:<span class="npc">“记住,死亡不是终点……”</span>`,
            choices: [
                { text: '�� 推开第一扇门(一人不入庙)', nextId: 'door1_arrive', hint: '进入原著第一个副本' },
                { text: '�� 环顾四周,寻找线索', nextId: 'start_look', hint: '也许能找到什么' },
                { text: '�� 回忆自己是谁', nextId: 'start_memory', hint: '你似乎失去了部分记忆' }
            ]
        },

        start_look: {
            id: 'start_look',
            location: '�� 万花筒起点',
            door: 0,
            text: `你仔细环顾四周,在虚空中发现了一张 <span class="item">泛黄的纸条</span> 。<br>
            上面写着:<i>“每一扇门都有它的规则,找到规则,才能活下去。”</i><br><br>
            你似乎想起了一些事情……`,
            choices: [
                { text: '�� 捡起纸条(获得道具:泛黄的纸条)', nextId: 'start_look_get', action: () => addItem('泛黄的纸条') },
                { text: '�� 推开第一扇门', nextId: 'door1_arrive' }
            ]
        },

        start_look_get: {
            id: 'start_look_get',
            location: '�� 万花筒起点',
            door: 0,
            text: `你捡起纸条,上面除了刚才的文字,还有一行小字:<br>
            <i>“—— 西子绪 · 死亡万花筒”</i><br><br>
            你感到一阵寒意。`,
            choices: [
                { text: '�� 推开第一扇门', nextId: 'door1_arrive' }
            ]
        },

        start_memory: {
            id: 'start_memory',
            location: '�� 万花筒起点',
            door: 0,
            text: `你闭上眼睛,碎片般的记忆闪过脑海……<br>
            你叫 <span class="npc">林秋石</span> ,你是一个…… 门内世界的人?<br>
            你隐约记得有个名字:<span class="npc">阮南烛</span> 。<br><br>
            <i>“他……是谁?”</i>`,
            choices: [
                { text: '�� 带着记忆推开第一扇门', nextId: 'door1_arrive', action: () => { state.memories += 2; showNotification('✧ 记忆碎片 +2'); } },
                { text: '�� 继续探索', nextId: 'start_look' }
            ]
        },

        // ========== 第一扇门:一人不入庙 ==========
        door1_arrive: {
            id: 'door1_arrive',
            location: '�� 古庙前 · 雨夜',
            door: 1,
            text: `你推开第一扇门,瞬间被雨水淋透。<br>
            你站在一座 <span class="highlight">破败的古庙</span> 前,庙门半掩。<br>
            庙中隐约可见一口 <span class="danger">棺材</span> 。<br><br>
            <i>“一人不入庙,二人不看井,三人不抱树,独坐莫凭栏。”</i><br><br>
            �� 一个苍老的声音从庙中传来:<span class="npc">“进来吧…… 我等你好久了。”</span>`,
            choices: [
                { text: '�� 走进庙中,查看棺材', nextId: 'door1_coffin', hint: '棺材里有什么?' },
                { text: '�� 绕到庙后,查看古井', nextId: 'door1_well', hint: '井里有门' },
                { text: '�� 背诵那句谚语', nextId: 'door1_proverb', hint: '也许有玄机' }
            ]
        },

        door1_coffin: {
            id: 'door1_coffin',
            location: '�� 古庙内 · 棺材前',
            door: 1,
            text: `你推开沉重的棺材盖,里面空无一人。<br>
            但棺材底部刻着一行血字:<br>
            <span class="highlight">“井中有门,莫问前程。”</span><br><br>
            你感觉有人在背后看着你。`,
            choices: [
                { text: '�� 转身去查看古井', nextId: 'door1_well' },
                { text: '�� 仔细检查棺材内部', nextId: 'door1_coffin_search', hint: '也许有遗漏' },
                { text: '�� 回头看看是谁在看你', nextId: 'door1_ghost' }
            ]
        },

        door1_coffin_search: {
            id: 'door1_coffin_search',
            location: '�� 古庙内 · 棺材中',
            door: 1,
            text: `你伸手在棺材里摸索,摸到了一把 <span class="item">锈蚀的钥匙</span> 。<br>
            钥匙上刻着:<i>“井底之门”</i><br><br>
            你隐约明白了什么。`,
            choices: [
                { text: '�� 带着钥匙去古井', nextId: 'door1_well', action: () => addItem('锈蚀的钥匙') }
            ]
        },

        door1_well: {
            id: 'door1_well',
            location: '�� 古庙后 · 古井边',
            door: 1,
            text: `你走到庙后的古井旁,井水漆黑如墨。<br>
            如果你有 <span class="item">锈蚀的钥匙</span> ,你看到井壁上有一把锁。<br><br>
            你听到井底传来声音:<span class="npc">“下来吧…… 门在这里。”</span>`,
            choices: [
                { text: '�� 用钥匙打开井壁的锁(需要:锈蚀的钥匙)', nextId: 'door1_gate', needItem: '锈蚀的钥匙' },
                { text: '�� 直接跳入井中', nextId: 'door1_drown', hint: '⚠️ 危险!' },
                { text: '�� 往井里扔一块石头', nextId: 'door1_stone' }
            ]
        },

        door1_stone: {
            id: 'door1_stone',
            location: '�� 古庙后 · 古井边',
            door: 1,
            text: `你扔下一块石头,过了很久才听到落水声。<br>
            这口井…… 深不见底。<br>
            你似乎听到了什么声音从井底传来。`,
            choices: [
                { text: '�� 用钥匙打开井壁的锁(需要:锈蚀的钥匙)', nextId: 'door1_gate', needItem: '锈蚀的钥匙' },
                { text: '�� 跳入井中', nextId: 'door1_drown' }
            ]
        },

        door1_drown: {
            id: 'door1_drown',
            location: '�� 井底 · 溺亡边缘',
            door: 1,
            text: `你跳入井中,但井水冰冷刺骨,你发现自己无法呼吸。<br>
            在失去意识前,你看到井底有一扇 <span class="highlight">青铜门</span> ……<br><br>
            <span class="danger">�� 你淹死了……</span><br>
            <i>但死亡万花筒中,死亡只是另一个开始。</i>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door1_arrive', action: () => { adjustHealth(-30); } }
            ]
        },

        door1_gate: {
            id: 'door1_gate',
            location: '�� 井底 · 青铜门前',
            door: 1,
            text: `你打开井壁的锁,井水自动分开,露出一条通道。<br>
            你走到底,看到一扇 <span class="highlight">青铜门</span> 缓缓打开。<br><br>
            ✅ 第一扇门通过!<br><br>
            <i>你感觉有什么东西在门后等着你……</i>`,
            choices: [
                { text: '�� 踏入第二扇门', nextId: 'door2_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        door1_proverb: {
            id: 'door1_proverb',
            location: '�� 古庙前',
            door: 1,
            text: `你低声念诵:<i>“一人不入庙,二人不看井,三人不抱树,独坐莫凭栏。”</i><br><br>
            突然,庙门自己打开了,你看到棺材里…… 坐着一个人。<br>
            那人转过头,对你说:<span class="npc">“你终于明白了。”</span><br><br>
            你获得了 <span class="item">一块玉佩</span> 。`,
            choices: [
                { text: '�� 捡起玉佩,进入庙中', nextId: 'door1_coffin', action: () => addItem('神秘玉佩') },
                { text: '�� 转身去古井', nextId: 'door1_well' }
            ]
        },

        door1_ghost: {
            id: 'door1_ghost',
            location: '�� 古庙内',
            door: 1,
            text: `你猛然回头,看到一个 <span class="npc">白衣女子</span> 站在你身后。<br>
            她幽幽地说:<i>“你…… 是来替我的吗?”</i><br><br>
            你感到一阵寒意,理智正在流失。`,
            choices: [
                { text: '�� “我是来找门的。”', nextId: 'door1_ghost_talk', action: () => adjustHealth(-10) },
                { text: '�� 转身就跑!', nextId: 'door1_well', action: () => adjustHealth(-5) }
            ]
        },

        door1_ghost_talk: {
            id: 'door1_ghost_talk',
            location: '�� 古庙内',
            door: 1,
            text: `白衣女子笑了:<i>“门在井底,但…… 你确定要进去吗?”</i><br>
            她递给一把 <span class="item">青铜钥匙</span> 。<br>
            <span class="npc">“拿着吧,后面的门更需要它。”</span>`,
            choices: [
                { text: '�� 接过钥匙,去古井', nextId: 'door1_well', action: () => addItem('青铜钥匙') }
            ]
        },

        // ========== 第二扇门:菲尔夏鸟 ==========
        door2_arrive: {
            id: 'door2_arrive',
            location: '�� 菲尔夏鸟 · 古宅前',
            door: 2,
            text: `你踏入第二扇门,来到一座 <span class="highlight">古老的宅邸</span> 前。<br>
            宅门上方雕刻着一只 <span class="danger">三头鸟</span> 。<br><br>
            <i>传说,这里是菲尔夏鸟的巢穴。</i><br><br>
            �� 一个女仆从门缝里探出头:<span class="npc">“客人…… 主人等您很久了。”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">沾血</span> 或 <span class="danger">说不出三胞胎名字</span>`,
            choices: [
                { text: '�� 跟随女仆进入古宅', nextId: 'door2_hall', hint: '正面进入' },
                { text: '�� 绕到宅子后面看看', nextId: 'door2_back', hint: '也许有别的入口' },
                { text: '�� 观察三头鸟雕像', nextId: 'door2_bird', hint: '也许有线索' }
            ]
        },

        door2_bird: {
            id: 'door2_bird',
            location: '�� 古宅前 · 三头鸟雕像',
            door: 2,
            text: `你仔细观察三头鸟雕像,发现每个头的嘴里都含着一颗 <span class="item">宝石</span> 。<br>
            你伸手取下一颗,鸟的眼睛突然动了!<br><br>
            <span class="npc">“你会后悔的……”</span> 一个声音在你耳边响起。`,
            choices: [
                { text: '�� 拿走宝石(获得:红宝石)', nextId: 'door2_hall', action: () => addItem('红宝石') },
                { text: '�� 不碰宝石,直接进宅', nextId: 'door2_hall' }
            ]
        },

        door2_back: {
            id: 'door2_back',
            location: '�� 古宅后院',
            door: 2,
            text: `你绕到宅子后面,看到二楼窗户里透出灯光。<br>
            一个 <span class="npc">小男孩</span> 趴在窗边,看到你后惊慌地缩了回去。<br>
            你听到他在喊:<i>“姐姐!有人来了!”</i><br><br>
            你注意到后门没有上锁。`,
            choices: [
                { text: '�� 从后门潜入', nextId: 'door2_kitchen' },
                { text: '�� 回到正门进入', nextId: 'door2_hall' }
            ]
        },

        door2_kitchen: {
            id: 'door2_kitchen',
            location: '�� 古宅 · 厨房',
            door: 2,
            text: `你从后门进入厨房,里面弥漫着血腥味。<br>
            你看到案板上有一把 <span class="item">带血的刀</span> ,旁边放着一本 <span class="item">旧日记</span> 。<br><br>
            你翻开日记,上面写着三胞胎的名字:<br>
            <span class="highlight">莉莉、安娜、苏珊</span> 。<br><br>
            <i>“记住她们的名字,否则你会死。”</i>`,
            choices: [
                { text: '�� 拿走日记(获得:旧日记)', nextId: 'door2_hall', action: () => addItem('旧日记') },
                { text: '�� 拿起带血的刀(获得:带血的刀)', nextId: 'door2_hall', action: () => addItem('带血的刀') }
            ]
        },

        door2_hall: {
            id: 'door2_hall',
            location: '�� 古宅 · 大厅',
            door: 2,
            text: `你走进大厅,看到一个 <span class="npc">贵妇</span> 坐在主位上。<br>
            她身边站着三个一模一样的 <span class="npc">女孩</span> 。<br><br>
            贵妇微笑:<i>“你来了。你能说出她们的名字吗?”</i><br><br>
            ⚠️ 如果你答错,你会死。`,
            choices: [
                { text: '�� “莉莉、安娜、苏珊。”(需要:旧日记)', nextId: 'door2_pass', needItem: '旧日记' },
                { text: '�� “她们是……三胞胎?”', nextId: 'door2_fail' },
                { text: '�� “我为什么要回答你?”', nextId: 'door2_fail' }
            ]
        },

        door2_fail: {
            id: 'door2_fail',
            location: '�� 古宅 · 大厅',
            door: 2,
            text: `贵妇的脸色瞬间阴沉。<br>
            <span class="danger">“你答错了。”</span><br><br>
            三胞胎同时转头看向你,她们的嘴角裂到耳根……<br>
            <span class="danger">�� 你被三胞胎撕碎了。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door2_arrive', action: () => { adjustHealth(-40); } }
            ]
        },

        door2_pass: {
            id: 'door2_pass',
            location: '�� 古宅 · 大厅',
            door: 2,
            text: `你准确地说出了三胞胎的名字。<br>
            贵妇的表情从阴冷变为惊讶,然后化为 <span class="highlight">微笑</span> 。<br><br>
            <i>“你通过了…… 去吧,门在楼顶。”</i><br><br>
            她指向通往楼上的楼梯。`,
            choices: [
                { text: '�� 前往楼顶', nextId: 'door2_roof', action: () => { state.shards += 2; state.memories += 1; } }
            ]
        },

        door2_roof: {
            id: 'door2_roof',
            location: '�� 古宅 · 楼顶',
            door: 2,
            text: `你走上楼顶,看到地上铺着几个 <span class="danger">裹尸袋</span> 。<br>
            你掀开其中一个,下面露出一扇 <span class="highlight">白色门</span> 。<br><br>
            ✅ 第二扇门通过!<br><br>
            <i>门后传来钢琴声……</i>`,
            choices: [
                { text: '�� 踏入第三扇门', nextId: 'door3_arrive', action: () => { state.doors += 1; adjustHealth(5); } }
            ]
        },

        // ========== 第三扇门:阿姐鼓 ==========
        door3_arrive: {
            id: 'door3_arrive',
            location: '�� 阿姐鼓 · 鼓楼',
            door: 3,
            text: `你踏入第三扇门,耳边响起 <span class="highlight">沉重的鼓声</span> 。<br>
            你站在一座 <span class="highlight">鼓楼</span> 前,楼上悬挂着一面 <span class="danger">人皮鼓</span> 。<br><br>
            <i>“阿姐的鼓声…… 听过的人都死了。”</i><br><br>
            �� 一个 <span class="npc">老妇人</span> 在鼓楼下喃喃自语:<span class="npc">“敲鼓,或者死。”</span>`,
            choices: [
                { text: '�� 走上鼓楼,敲响人皮鼓', nextId: 'door3_drum', hint: '也许能发现什么' },
                { text: '�� 与老妇人交谈', nextId: 'door3_oldwoman', hint: '她可能知道线索' },
                { text: '�� 绕到鼓楼后面看看', nextId: 'door3_back' }
            ]
        },

        door3_oldwoman: {
            id: 'door3_oldwoman',
            location: '�� 鼓楼前',
            door: 3,
            text: `老妇人抬起头,眼神空洞:<br>
            <span class="npc">“阿姐的鼓…… 是用她自己的皮做的。”</span><br>
            <span class="npc">“她的妹妹…… 是下一个。”</span><br><br>
            她递给你一把 <span class="item">小刀</span> 。<br>
            <i>“划破鼓面…… 门就会出现。”</i>`,
            choices: [
                { text: '�� 接过小刀,去敲鼓', nextId: 'door3_drum', action: () => addItem('小刀') },
                { text: '�� 直接去敲鼓', nextId: 'door3_drum' }
            ]
        },

        door3_back: {
            id: 'door3_back',
            location: '�� 鼓楼后面',
            door: 3,
            text: `你绕到鼓楼后面,看到地上散落着 <span class="item">破碎的鼓皮</span> 。<br>
            你捡起一块,上面写着:<i>“划破鼓面,门自显现。”</i><br><br>
            你似乎明白了什么。`,
            choices: [
                { text: '�� 回到正面,敲鼓', nextId: 'door3_drum' }
            ]
        },

        door3_drum: {
            id: 'door3_drum',
            location: '�� 鼓楼 · 人皮鼓前',
            door: 3,
            text: `你站在人皮鼓前,鼓面上隐约可见一张 <span class="danger">人脸</span> 。<br>
            你举起手—— 敲,还是不敲?<br><br>
            如果你有 <span class="item">小刀</span> ,你可以划破鼓面。`,
            choices: [
                { text: '�� 用小刀划破鼓面(需要:小刀)', nextId: 'door3_gate', needItem: '小刀' },
                { text: '�� 用力敲响鼓', nextId: 'door3_beat' },
                { text: '�� 转身离开', nextId: 'door3_leave' }
            ]
        },

        door3_beat: {
            id: 'door3_beat',
            location: '�� 鼓楼 · 鼓声回荡',
            door: 3,
            text: `你用力敲响人皮鼓,鼓声震天。<br>
            整座鼓楼开始震动,你看到鼓面上的人脸在 <span class="danger">哭泣</span> 。<br><br>
            你感觉理智在流失……`,
            choices: [
                { text: '�� 用刀划破鼓面(需要:小刀)', nextId: 'door3_gate', needItem: '小刀', action: () => adjustHealth(-10) },
                { text: '�� 逃离鼓楼', nextId: 'door3_leave', action: () => adjustHealth(-20) }
            ]
        },

        door3_leave: {
            id: 'door3_leave',
            location: '�� 鼓楼外',
            door: 3,
            text: `你逃离了鼓楼,但鼓声在你脑中回荡。<br>
            你看到远处的 <span class="highlight">门</span> 正在消失……<br><br>
            <i>“你错过了机会。”</i>`,
            choices: [
                { text: '�� 重新尝试', nextId: 'door3_arrive', action: () => adjustHealth(-15) }
            ]
        },

        door3_gate: {
            id: 'door3_gate',
            location: '�� 鼓楼 · 门现',
            door: 3,
            text: `你划破鼓面,鲜血从鼓中流出。<br>
            一张 <span class="item">泛黄的纸条</span> 从鼓中掉落:<br>
            <i>“姐姐划破鼓面之时,门即显现。”</i><br><br>
            鼓声突然停止,一扇 <span class="highlight">红色门</span> 在鼓楼中央出现。<br><br>
            ✅ 第三扇门通过!`,
            choices: [
                { text: '�� 踏入第四扇门', nextId: 'door4_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第四扇门:雨中女郎 ==========
        door4_arrive: {
            id: 'door4_arrive',
            location: '�� 雨中女郎 · 画廊',
            door: 4,
            text: `你踏入第四扇门,来到一座 <span class="highlight">画廊</span> 。<br>
            窗外下着雨,一幅巨大的 <span class="danger">雨中女郎</span> 画作挂在墙上。<br><br>
            <i>“你站在桥上看风景,看风景的人在楼上看你。”</i><br><br>
            �� 画廊里站着一个 <span class="npc">穿雨衣的男人</span> 。<br>
            <span class="npc">“别碰那幅画…… 你会死的。”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">被画框框住</span>、<span class="danger">对画动手</span>、<span class="danger">进入逆转世界</span>`,
            choices: [
                { text: '��️ 仔细观察雨中女郎的画', nextId: 'door4_painting' },
                { text: '��️ 与穿雨衣的男人交谈', nextId: 'door4_man' },
                { text: '�� 探索画廊的其他房间', nextId: 'door4_explore' }
            ]
        },

        door4_man: {
            id: 'door4_man',
            location: '�� 画廊',
            door: 4,
            text: `穿雨衣的男人低声说:<span class="npc">“我是上一轮进来的人。”</span><br>
            <span class="npc">“我看到了…… 门在二楼右边楼梯的尽头。”</span><br>
            <span class="npc">“但是…… 你需要烧掉那幅 <span class="item">晚宴图</span> 才能看到门。”</span><br><br>
            他递给你一盒 <span class="item">火柴</span> 。`,
            choices: [
                { text: '�� 接过火柴,寻找晚宴图', nextId: 'door4_explore', action: () => addItem('火柴') },
                { text: '��️ 先去看雨中女郎的画', nextId: 'door4_painting' }
            ]
        },

        door4_painting: {
            id: 'door4_painting',
            location: '�� 画廊 · 雨中女郎前',
            door: 4,
            text: `你站在雨中女郎的画前,画中的女人似乎在 <span class="danger">看着你</span> 。<br>
            她的嘴角微微上扬……<br><br>
            你感觉周围的世界在 <span class="danger">颠倒</span> 。<br><br>
            你看到了画框在向你逼近!`,
            choices: [
                { text: '�� 立刻后退!', nextId: 'door4_explore', action: () => adjustHealth(-10) },
                { text: '�� 用火柴烧掉旁边的晚宴图(需要:火柴)', nextId: 'door4_burn', needItem: '火柴' },
                { text: '�� 触摸画作', nextId: 'door4_touch' }
            ]
        },

        door4_touch: {
            id: 'door4_touch',
            location: '�� 画廊 · 画前',
            door: 4,
            text: `你伸出手触摸画作,指尖触及画布的瞬间……<br>
            你被吸入画中!<br><br>
            你发现自己站在雨中,而画中的女人正 <span class="danger">站在你身后</span> 。<br>
            <span class="danger">�� 你成了画的一部分。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door4_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door4_explore: {
            id: 'door4_explore',
            location: '�� 画廊 · 其他房间',
            door: 4,
            text: `你在画廊的其他房间里找到了一幅 <span class="item">晚宴图</span> 。<br>
            画中的人们在宴会厅里狂欢,但所有人都是 <span class="danger">没有脸</span> 的。<br><br>
            你感觉这幅画在 <span class="danger">燃烧</span> 。`,
            choices: [
                { text: '�� 用火柴烧掉晚宴图(需要:火柴)', nextId: 'door4_burn', needItem: '火柴' },
                { text: '��️ 把画带走', nextId: 'door4_explore2', action: () => addItem('无脸晚宴图') }
            ]
        },

        door4_explore2: {
            id: 'door4_explore2',
            location: '�� 画廊 · 其他房间',
            door: 4,
            text: `你把画取下来,发现画框后面刻着一行字:<br>
            <span class="highlight">“门在二楼右边楼梯,烧掉画,门自现。”</span><br><br>
            你明白了。`,
            choices: [
                { text: '�� 烧掉晚宴图', nextId: 'door4_burn', action: () => { removeItem('无脸晚宴图'); } }
            ]
        },

        door4_burn: {
            id: 'door4_burn',
            location: '�� 画廊 · 燃烧的晚宴图',
            door: 4,
            text: `你点燃晚宴图,火焰中浮现出一扇 <span class="highlight">蓝色门</span> 。<br>
            门在二楼右边楼梯的尽头。<br><br>
            <i>“你看到风景了吗?”</i> 一个声音在你耳边响起。<br><br>
            ✅ 第四扇门通过!`,
            choices: [
                { text: '�� 踏入第五扇门', nextId: 'door5_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第五扇门:佐子 ==========
        door5_arrive: {
            id: 'door5_arrive',
            location: '�� 佐子 · 旧校舍',
            door: 5,
            text: `你踏入第五扇门,来到一座 <span class="highlight">废弃的旧校舍</span> 。<br>
            走廊里回荡着 <span class="danger">少女的笑声</span> 。<br><br>
            <i>“我的腿没有了…… 你的给我好吗?”</i><br><br>
            �� 一个穿着校服的 <span class="npc">女孩</span> 坐在教室门口。<br>
            她背对着你,正在哼歌。<br><br>
            ⚠️ 死亡条件:<span class="danger">念出那句话</span>`,
            choices: [
                { text: '�� 走近那个女孩', nextId: 'door5_girl' },
                { text: '�� 探索旧校舍', nextId: 'door5_explore' },
                { text: '�� 寻找高二三班的教室', nextId: 'door5_classroom' }
            ]
        },

        door5_girl: {
            id: 'door5_girl',
            location: '�� 旧校舍 · 走廊',
            door: 5,
            text: `你走近那个女孩,她慢慢转过头……<br>
            她的脸是 <span class="danger">空的</span> 。<br><br>
            她开口了:<span class="npc">“你愿意陪我玩吗?”</span><br><br>
            你看到她的裙子下面…… 没有腿。<br>
            <i>她飘在空中。</i>`,
            choices: [
                { text: '�� “我陪你玩。”', nextId: 'door5_play', action: () => adjustHealth(-5) },
                { text: '�� 后退,去教室', nextId: 'door5_classroom' }
            ]
        },

        door5_play: {
            id: 'door5_play',
            location: '�� 旧校舍 · 走廊',
            door: 5,
            text: `女孩笑了:<span class="npc">“那…… 你帮我杀两个人吧。”</span><br>
            <span class="npc">“高二三班最后两个同学…… 他们欺负过我。”</span><br><br>
            她递给你一把 <span class="item">美工刀</span> 。<br>
            <i>“杀了他们,门就会出现。”</i>`,
            choices: [
                { text: '�� 接过美工刀,去找高二三班', nextId: 'door5_classroom', action: () => addItem('美工刀') },
                { text: '�� “我不能杀人。”', nextId: 'door5_refuse' }
            ]
        },

        door5_refuse: {
            id: 'door5_refuse',
            location: '�� 旧校舍 · 走廊',
            door: 5,
            text: `你拒绝了女孩的请求。<br>
            她的表情瞬间变得狰狞:<span class="danger">“那你就去死吧!”</span><br><br>
            你感觉双腿传来剧痛——<br>
            <span class="danger">�� 你的腿被夺走了。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door5_arrive', action: () => adjustHealth(-60) }
            ]
        },

        door5_explore: {
            id: 'door5_explore',
            location: '�� 旧校舍 · 教室',
            door: 5,
            text: `你走进一间教室,黑板上写着 <span class="highlight">“佐子”</span> 两个字。<br>
            讲台上放着一本 <span class="item">班级相册</span> 。<br>
            你翻开相册,看到高二三班的合影——<br>
            所有人的脸都是 <span class="danger">模糊的</span> 。`,
            choices: [
                { text: '�� 拿走相册', nextId: 'door5_classroom', action: () => addItem('班级相册') },
                { text: '�� 继续搜索', nextId: 'door5_classroom' }
            ]
        },

        door5_classroom: {
            id: 'door5_classroom',
            location: '�� 旧校舍 · 高二三班',
            door: 5,
            text: `你走进高二三班的教室,里面坐着两个 <span class="npc">学生</span> 。<br>
            他们看到你,露出诡异的微笑。<br>
            <span class="npc">“你是来…… 帮佐子报仇的吗?”</span><br><br>
            如果你有 <span class="item">美工刀</span> ,你可以动手。<br>
            如果你有 <span class="item">班级相册</span> ,你会发现照片在自燃。`,
            choices: [
                { text: '�� 用美工刀解决他们(需要:美工刀)', nextId: 'door5_kill', needItem: '美工刀' },
                { text: '�� 拿出班级相册(需要:班级相册)', nextId: 'door5_photo', needItem: '班级相册' },
                { text: '�� 和他们交谈', nextId: 'door5_talk' }
            ]
        },

        door5_talk: {
            id: 'door5_talk',
            location: '�� 旧校舍 · 高二三班',
            door: 5,
            text: `你试图和他们交谈,但他们只是重复着同一句话:<br>
            <span class="danger">“佐子…… 佐子…… 佐子……”</span><br><br>
            你感觉周围的气温在下降。<br>
            你逐渐失去意识……`,
            choices: [
                { text: '�� 用美工刀解决他们(需要:美工刀)', nextId: 'door5_kill', needItem: '美工刀' },
                { text: '�� 拿出班级相册(需要:班级相册)', nextId: 'door5_photo', needItem: '班级相册' }
            ]
        },

        door5_photo: {
            id: 'door5_photo',
            location: '�� 旧校舍 · 高二三班',
            door: 5,
            text: `你拿出班级相册,相册突然 <span class="danger">自燃</span> 。<br>
            火焰中,你看到一扇 <span class="highlight">黑色门</span> 出现在讲台后面。<br><br>
            那两个学生发出惨叫,化为灰烬。<br><br>
            ✅ 第五扇门通过!`,
            choices: [
                { text: '�� 踏入第六扇门', nextId: 'door6_arrive', action: () => { state.doors += 1; state.shards += 2; state.memories += 1; adjustHealth(5); } }
            ]
        },

        door5_kill: {
            id: 'door5_kill',
            location: '�� 旧校舍 · 高二三班',
            door: 5,
            text: `你用美工刀解决了那两个学生。<br>
            他们的血在地板上汇成一行字:<br>
            <span class="highlight">“门在讲台后面,推开它。”</span><br><br>
            你看到一扇 <span class="highlight">黑色门</span> 出现。<br><br>
            ✅ 第五扇门通过!`,
            choices: [
                { text: '�� 踏入第六扇门', nextId: 'door6_arrive', action: () => { state.doors += 1; state.shards += 2; state.memories += 1; adjustHealth(5); } }
            ]
        },

        // ========== 第六扇门:瘦长鬼影 ==========
        door6_arrive: {
            id: 'door6_arrive',
            location: '�� 瘦长鬼影 · 广场',
            door: 6,
            text: `你踏入第六扇门,来到一个 <span class="highlight">空旷的广场</span> 。<br>
            天空中悬浮着一个 <span class="danger">穿黑色西装、戴礼帽</span> 的瘦长身影。<br><br>
            <i>他…… 在看着你。</i><br><br>
            �� 广场上还有一个 <span class="npc">流浪汉</span> 在角落里发抖。<br>
            <span class="npc">“别戴那顶帽子…… 会死的。”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">戴上黑色礼帽</span>、<span class="danger">迷失在幻觉中</span>`,
            choices: [
                { text: '�� 走向瘦长鬼影', nextId: 'door6_shadow' },
                { text: '��️ 与流浪汉交谈', nextId: 'door6_hobo' },
                { text: '�� 查看广场上的告示牌', nextId: 'door6_sign' }
            ]
        },

        door6_hobo: {
            id: 'door6_hobo',
            location: '�� 广场 · 角落',
            door: 6,
            text: `流浪汉颤抖着说:<span class="npc">“他…… 他会让你看到最害怕的东西。”</span><br>
            <span class="npc">“门…… 门在告示牌下面。”</span><br>
            <span class="npc">“但是…… 你需要从他身体里拿到钥匙。”</span><br><br>
            他给你一个 <span class="item">护身符</span> 。<br>
            <i>“戴着它,能抵御一次幻觉。”</i>`,
            choices: [
                { text: '�� 接过护身符,去找瘦长鬼影', nextId: 'door6_shadow', action: () => addItem('护身符') },
                { text: '�� 先去查看告示牌', nextId: 'door6_sign' }
            ]
        },

        door6_shadow: {
            id: 'door6_shadow',
            location: '�� 广场 · 瘦长鬼影下方',
            door: 6,
            text: `你走到瘦长鬼影下方,他缓缓低头看向你。<br>
            他的脸是 <span class="danger">空白的</span> 。<br><br>
            他开口了,声音像金属摩擦:<br>
            <span class="npc">“你…… 看到了什么?”</span><br><br>
            你周围的景象开始 <span class="danger">扭曲</span> 。<br>
            你看到了…… 你最害怕的东西。`,
            choices: [
                { text: '�� 坚持住,伸手去拿他身上的钥匙', nextId: 'door6_take', action: () => adjustHealth(-15) },
                { text: '�� 使用护身符(需要:护身符)', nextId: 'door6_amulets', needItem: '护身符' },
                { text: '�� 逃离幻觉', nextId: 'door6_flee', action: () => adjustHealth(-25) }
            ]
        },

        door6_amulets: {
            id: 'door6_amulets',
            location: '�� 广场 · 幻觉中',
            door: 6,
            text: `你紧握护身符,幻觉瞬间破碎。<br>
            你看到瘦长鬼影的身体里有一把 <span class="item">银色钥匙</span> 。<br>
            你伸手取出钥匙,他没有反抗。<br><br>
            <span class="npc">“你…… 很强。”</span> 他消失了。`,
            choices: [
                { text: '�� 带着钥匙去告示牌', nextId: 'door6_sign', action: () => addItem('银色钥匙') }
            ]
        },

        door6_take: {
            id: 'door6_take',
            location: '�� 广场 · 幻觉中',
            door: 6,
            text: `你强行在幻觉中伸手,触碰到瘦长鬼影的身体。<br>
            你摸到了一把 <span class="item">银色钥匙</span> ,用力扯了出来。<br><br>
            幻觉消失,你发现自己的手在 <span class="danger">流血</span> 。<br>
            但你成功了。`,
            choices: [
                { text: '�� 带着钥匙去告示牌', nextId: 'door6_sign', action: () => { addItem('银色钥匙'); adjustHealth(-15); } }
            ]
        },

        door6_flee: {
            id: 'door6_flee',
            location: '�� 广场 · 告示牌旁',
            door: 6,
            text: `你从幻觉中逃出,但瘦长鬼影已经 <span class="danger">站在你身后</span> 。<br>
            他慢慢摘下帽子……<br><br>
            你感觉意识在模糊。<br>
            <span class="danger">�� 你迷失在永恒的幻觉中。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door6_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door6_sign: {
            id: 'door6_sign',
            location: '�� 广场 · 告示牌',
            door: 6,
            text: `你走到告示牌前,上面贴着一张泛黄的公告:<br>
            <i>“寻找丢失的帽子…… 重金酬谢。”</i><br><br>
            你看到告示牌下面有一个 <span class="highlight">锁孔</span> 。<br>
            如果你有 <span class="item">银色钥匙</span> ,你可以打开它。`,
            choices: [
                { text: '�� 用银色钥匙打开(需要:银色钥匙)', nextId: 'door6_gate', needItem: '银色钥匙' },
                { text: '�� 寻找其他方法', nextId: 'door6_other' }
            ]
        },

        door6_other: {
            id: 'door6_other',
            location: '�� 广场 · 告示牌',
            door: 6,
            text: `你试图撬开告示牌,但它纹丝不动。<br>
            你听到瘦长鬼影的声音在远处响起……<br>
            你时间不多了。`,
            choices: [
                { text: '�� 用银色钥匙打开(需要:银色钥匙)', nextId: 'door6_gate', needItem: '银色钥匙' },
                { text: '�� 再次挑战瘦长鬼影', nextId: 'door6_shadow', action: () => adjustHealth(-5) }
            ]
        },

        door6_gate: {
            id: 'door6_gate',
            location: '�� 广场 · 门现',
            door: 6,
            text: `你用银色钥匙打开告示牌下面的锁。<br>
            地面裂开,一扇 <span class="highlight">灰色门</span> 缓缓升起。<br><br>
            ✅ 第六扇门通过!<br><br>
            <i>你听到门后传来…… 歌声。</i>`,
            choices: [
                { text: '�� 踏入第七扇门', nextId: 'door7_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第七扇门:威福利山疗养院 ==========
        door7_arrive: {
            id: 'door7_arrive',
            location: '�� 威福利山疗养院 · 大厅',
            door: 7,
            text: `你踏入第七扇门,来到 <span class="highlight">威福利山疗养院</span> 。<br>
            空气中弥漫着消毒水的气味。<br>
            走廊里传来 <span class="danger">轮椅滚动的声音</span> 。<br><br>
            <i>“502…… 502……”</i><br><br>
            �� 一个 <span class="npc">护士</span> 站在前台,她微笑着看着你。<br>
            <span class="npc">“你是…… 新来的病人吗?”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">进入502房间</span>`,
            choices: [
                { text: '�� “我是来参观的。”', nextId: 'door7_talk' },
                { text: '�� 探索疗养院', nextId: 'door7_explore' },
                { text: '�� 直接去找502房间', nextId: 'door7_502' }
            ]
        },

        door7_talk: {
            id: 'door7_talk',
            location: '�� 疗养院 · 大厅',
            door: 7,
            text: `护士歪着头:<span class="npc">“参观?这里可没什么好参观的。”</span><br>
            <span class="npc">“不过…… 如果你感兴趣,可以去看看 <span class="item">护士和医生的合照</span> 。”</span><br>
            <span class="npc">“在走廊尽头的墙上挂着。”</span><br><br>
            她似乎知道些什么。`,
            choices: [
                { text: '��️ 去看合照', nextId: 'door7_photo' },
                { text: '�� 探索疗养院', nextId: 'door7_explore' }
            ]
        },

        door7_photo: {
            id: 'door7_photo',
            location: '�� 疗养院 · 走廊尽头',
            door: 7,
            text: `你走到走廊尽头,看到墙上挂着一幅 <span class="item">护士和医生的合照</span> 。<br>
            你掀开相框,后面刻着一行字:<br>
            <span class="highlight">“门在楼梯后面的隧道里,避开502。”</span><br><br>
            你听到远处传来502房间的开门声……`,
            choices: [
                { text: '�� 去楼梯后面', nextId: 'door7_tunnel' },
                { text: '�� 去查看502房间', nextId: 'door7_502' }
            ]
        },

        door7_explore: {
            id: 'door7_explore',
            location: '�� 疗养院 · 走廊',
            door: 7,
            text: `你在走廊里探索,看到了 <span class="danger">502房间</span> 的门牌。<br>
            门缝里透出微弱的光。<br>
            你听到里面有人在 <span class="danger">哭泣</span> 。<br><br>
            你注意到楼梯后面似乎有一个 <span class="highlight">通道</span> 。`,
            choices: [
                { text: '�� 去楼梯后面的通道', nextId: 'door7_tunnel' },
                { text: '�� 打开502房间的门', nextId: 'door7_502' }
            ]
        },

        door7_502: {
            id: 'door7_502',
            location: '�� 疗养院 · 502房间',
            door: 7,
            text: `你推开502房间的门……<br>
            里面空无一人,但墙上写满了 <span class="danger">“救我”</span> 。<br><br>
            你转身想离开,但门已经 <span class="danger">锁上了</span> 。<br>
            你听到有人在敲门,但门外的脚步声越来越近……<br><br>
            <span class="danger">�� 你被困在了502房间,永远无法离开。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door7_arrive', action: () => adjustHealth(-60) }
            ]
        },

        door7_tunnel: {
            id: 'door7_tunnel',
            location: '�� 疗养院 · 楼梯后的隧道',
            door: 7,
            text: `你走到楼梯后面,发现一个隐蔽的隧道入口。<br>
            隧道里很黑,但尽头有一丝 <span class="highlight">光亮</span> 。<br><br>
            你走进去,越走越深……<br><br>
            隧道的尽头是一扇 <span class="highlight">银色门</span> 。<br><br>
            ✅ 第七扇门通过!`,
            choices: [
                { text: '�� 踏入第八扇门', nextId: 'door8_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第八扇门:以铜为镜 ==========
        door8_arrive: {
            id: 'door8_arrive',
            location: '�� 镜屋 · 以铜为镜',
            door: 8,
            text: `你踏入第八扇门,来到一间 <span class="highlight">四面都是镜子</span> 的房间。<br>
            墙上刻着一行字:<br>
            <i>“以铜为镜,可以正衣冠;以史为镜,可以知兴替;以人为镜,可以明得失。”</i><br><br>
            �� 你看到镜子里有一个 <span class="npc">模糊的身影</span> 在向你招手。<br><br>
            ⚠️ 死亡条件:<span class="danger">打破镜子</span>`,
            choices: [
                { text: '�� 走向那个模糊的身影', nextId: 'door8_mirror' },
                { text: '�� 寻找出口', nextId: 'door8_explore' },
                { text: '�� 对着镜子说话', nextId: 'door8_talk' }
            ]
        },

        door8_mirror: {
            id: 'door8_mirror',
            location: '�� 镜屋 · 镜子前',
            door: 8,
            text: `你走到镜子前,里面的身影逐渐清晰——<br>
            那是 <span class="npc">你自己</span> 。<br>
            但镜中的你 <span class="danger">在笑</span> ,而你没有。<br><br>
            镜中的你开口了:<span class="npc">“你想离开吗?”</span><br>
            <span class="npc">“门在…… 安全通道。”</span><br>
            <span class="npc">“但你要先找到 <span class="item">全家福</span> 。在烧焦的房子里。”</span>`,
            choices: [
                { text: '�� 去寻找烧焦的房子', nextId: 'door8_house' },
                { text: '�� 继续和镜中的自己对话', nextId: 'door8_mirror2' }
            ]
        },

        door8_mirror2: {
            id: 'door8_mirror2',
            location: '�� 镜屋 · 镜子前',
            door: 8,
            text: `镜中的你继续说:<span class="npc">“不要打破任何一面镜子……”</span><br>
            <span class="npc">“否则你会永远留在这里。”</span><br><br>
            你感觉周围的镜子在 <span class="danger">向你逼近</span> 。`,
            choices: [
                { text: '�� 去寻找烧焦的房子', nextId: 'door8_house' },
                { text: '�� 立刻冲向安全通道', nextId: 'door8_exit' }
            ]
        },

        door8_explore: {
            id: 'door8_explore',
            location: '�� 镜屋 · 探索',
            door: 8,
            text: `你在镜屋中探索,发现一扇通往 <span class="highlight">烧焦的房子</span> 的门。<br>
            你走进去,看到一片废墟。<br>
            废墟中央,有一张 <span class="item">全家福</span> 照片。<br><br>
            照片里,一家三口都在 <span class="danger">笑着</span> 。`,
            choices: [
                { text: '�� 拿起全家福', nextId: 'door8_house2', action: () => addItem('全家福') }
            ]
        },

        door8_house: {
            id: 'door8_house',
            location: '�� 烧焦的房子',
            door: 8,
            text: `你找到烧焦的房子,里面空无一人。<br>
            你在地上看到一张 <span class="item">全家福</span> 。<br>
            照片背面写着:<span class="highlight">“门在安全通道,切勿打碎镜子。”</span>`,
            choices: [
                { text: '�� 拿起全家福', nextId: 'door8_house2', action: () => addItem('全家福') }
            ]
        },

        door8_house2: {
            id: 'door8_house2',
            location: '�� 烧焦的房子',
            door: 8,
            text: `你拿起全家福,照片在你手中 <span class="danger">自燃</span> 。<br>
            火焰中,你看到一扇 <span class="highlight">金色门</span> 在安全通道的方向出现。<br><br>
            ✅ 第八扇门通过!`,
            choices: [
                { text: '�� 踏入第九扇门', nextId: 'door9_arrive', action: () => { state.doors += 1; state.shards += 2; state.memories += 1; adjustHealth(5); } }
            ]
        },

        door8_exit: {
            id: 'door8_exit',
            location: '�� 安全通道 · 门现',
            door: 8,
            text: `你冲向安全通道,看到一扇 <span class="highlight">金色门</span> 在等你。<br><br>
            ✅ 第八扇门通过!`,
            choices: [
                { text: '�� 踏入第九扇门', nextId: 'door9_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第九扇门:哭儿郎 ==========
        door9_arrive: {
            id: 'door9_arrive',
            location: '�� 哭儿郎 · 老宅',
            door: 9,
            text: `你踏入第九扇门,来到一座 <span class="highlight">阴沉的老宅</span> 。<br>
            你听到楼上传来 <span class="danger">孩童的哭声</span> 。<br><br>
            <i>“天惶惶,地惶惶,我家有个哭儿郎,路过此处念三遍,一觉睡到大天光。”</i><br><br>
            �� 一个 <span class="npc">女主人</span> 从楼梯上走下来,她面无表情。<br>
            <span class="npc">“你…… 是来替我照顾孩子的吗?”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">房间里没有油灯</span>、<span class="danger">醒着时被女主人看到</span>`,
            choices: [
                { text: '�� “我来帮你照顾孩子。”', nextId: 'door9_child' },
                { text: '�� 探索老宅', nextId: 'door9_explore' },
                { text: '�� 念那首歌谣', nextId: 'door9_song' }
            ]
        },

        door9_song: {
            id: 'door9_song',
            location: '�� 老宅 · 客厅',
            door: 9,
            text: `你低声念诵那首歌谣。<br>
            哭声突然 <span class="danger">停止了</span> 。<br><br>
            女主人愣住了,然后 <span class="danger">笑了</span> 。<br>
            <span class="npc">“你…… 是来带走他的吗?”</span><br><br>
            她指向楼上。`,
            choices: [
                { text: '�� 上楼去看孩子', nextId: 'door9_child' },
                { text: '�� 探索老宅', nextId: 'door9_explore' }
            ]
        },

        door9_child: {
            id: 'door9_child',
            location: '�� 老宅 · 儿童房',
            door: 9,
            text: `你走上楼,推开儿童房的门。<br>
            房间里点着一盏 <span class="item">油灯</span> ,一个 <span class="npc">小男孩</span> 坐在床上哭泣。<br><br>
            他抬起头,看到你后停止了哭泣。<br>
            <span class="npc">“你…… 是来救我的吗?”</span><br><br>
            你发现油灯旁边有一个 <span class="highlight">柜子</span> 。`,
            choices: [
                { text: '�� 拿起油灯', nextId: 'door9_lamp', action: () => addItem('油灯') },
                { text: '�� 打开柜子', nextId: 'door9_closet' }
            ]
        },

        door9_lamp: {
            id: 'door9_lamp',
            location: '�� 老宅 · 儿童房',
            door: 9,
            text: `你拿起油灯,发现灯座上刻着一行字:<br>
            <span class="highlight">“门在女主人的卧室柜子里,保持油灯不灭。”</span><br><br>
            你听到楼下传来脚步声…… 女主人正在上楼。`,
            choices: [
                { text: '�� 拿着油灯,去找女主人的卧室', nextId: 'door9_bedroom', action: () => adjustHealth(-5) }
            ]
        },

        door9_closet: {
            id: 'door9_closet',
            location: '�� 老宅 · 儿童房 · 柜子前',
            door: 9,
            text: `你打开柜子,里面是空的。<br>
            但你看到柜子内壁上写着:<span class="highlight">“油灯不灭,门自显现。”</span><br><br>
            你听到楼下的脚步声越来越近。`,
            choices: [
                { text: '�� 拿起油灯', nextId: 'door9_lamp', action: () => addItem('油灯') }
            ]
        },

        door9_explore: {
            id: 'door9_explore',
            location: '�� 老宅 · 走廊',
            door: 9,
            text: `你在老宅中探索,发现了一间 <span class="highlight">女主人的卧室</span> 。<br>
            卧室里有一个大衣柜,但门是 <span class="danger">锁着的</span> 。<br><br>
            你听到儿童房里传来哭声。`,
            choices: [
                { text: '�� 去儿童房看看', nextId: 'door9_child' },
                { text: '�� 尝试打开衣柜', nextId: 'door9_closet2' }
            ]
        },

        door9_closet2: {
            id: 'door9_closet2',
            location: '�� 老宅 · 女主人的卧室',
            door: 9,
            text: `你试图打开衣柜,发现需要一把 <span class="item">钥匙</span> 。<br>
            你记得 …… 钥匙可能在 <span class="npc">女主人</span> 身上。`,
            choices: [
                { text: '�� 回去找女主人', nextId: 'door9_back' },
                { text: '�� 强行撬开衣柜', nextId: 'door9_break' }
            ]
        },

        door9_back: {
            id: 'door9_back',
            location: '�� 老宅 · 客厅',
            door: 9,
            text: `你回到客厅,女主人正在 <span class="danger">等你</span> 。<br>
            她手里拿着一把 <span class="item">钥匙</span> 。<br>
            <span class="npc">“你想要这个?”</span><br>
            <span class="npc">“那你…… 替我去照顾孩子吧。”</span>`,
            choices: [
                { text: '�� “我答应你。”', nextId: 'door9_child', action: () => addItem('卧室钥匙') },
                { text: '�� 强行抢夺钥匙', nextId: 'door9_fight' }
            ]
        },

        door9_fight: {
            id: 'door9_fight',
            location: '�� 老宅 · 客厅',
            door: 9,
            text: `你试图抢夺钥匙,但女主人的力量出奇地大。<br>
            你被她推倒在地,听到她阴森的声音:<br>
            <span class="danger">“那就留下来陪我吧……”</span><br><br>
            <span class="danger">�� 你被永远困在了老宅里。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door9_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door9_break: {
            id: 'door9_break',
            location: '�� 老宅 · 卧室衣柜前',
            door: 9,
            text: `你强行撬开衣柜,但发出巨大的声响。<br>
            你听到女主人 <span class="danger">尖叫</span> 着冲上楼。<br><br>
            你在衣柜里看到一扇 <span class="highlight">紫色门</span> ,但女主人已经出现在你身后……<br><br>
            <span class="danger">�� 你来不及了。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door9_arrive', action: () => adjustHealth(-40) }
            ]
        },

        door9_bedroom: {
            id: 'door9_bedroom',
            location: '�� 老宅 · 女主人卧室',
            door: 9,
            text: `你拿着油灯冲进女主人的卧室,用钥匙打开衣柜。<br>
            柜子里出现一扇 <span class="highlight">紫色门</span> 。<br><br>
            你听到女主人就在门外……<br><br>
            ✅ 第九扇门通过!<br><br>
            你跳进门中,门在你身后 <span class="danger">关闭</span> 。`,
            choices: [
                { text: '�� 踏入第十扇门', nextId: 'door10_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第十扇门:晴天娃娃 ==========
        door10_arrive: {
            id: 'door10_arrive',
            location: '�� 晴天娃娃 · 神寺',
            door: 10,
            text: `你踏入第十扇门,来到一座 <span class="highlight">古老的寺庙</span> 。<br>
            屋檐下挂着一排 <span class="danger">晴天娃娃</span> 。<br><br>
            <i>“晴天娃娃,晴天娃娃,请让明天是个晴天。”</i><br><br>
            �� 一个 <span class="npc">僧人</span> 跪在佛像前,他的头…… <span class="danger">掉在地上</span> 。<br><br>
            ⚠️ 死亡条件:<span class="danger">被雨淋到</span>`,
            choices: [
                { text: '�� 为僧人安回头颅', nextId: 'door10_monk' },
                { text: '�� 搜索寺庙', nextId: 'door10_search' },
                { text: '�� 触碰晴天娃娃', nextId: 'door10_doll' }
            ]
        },

        door10_monk: {
            id: 'door10_monk',
            location: '�� 神寺 · 佛像前',
            door: 10,
            text: `你捡起僧人的头颅,小心地放回他的脖子上。<br>
            他的眼睛突然 <span class="danger">睁开</span> 。<br>
            <span class="npc">“谢谢你……”</span><br>
            他的身体化为一道光芒,在佛像前凝聚成一把 <span class="item">钥匙</span> 。<br><br>
            你听到外面开始 <span class="danger">下雨</span> 了。`,
            choices: [
                { text: '�� 拿起钥匙', nextId: 'door10_key', action: () => addItem('法阵钥匙') }
            ]
        },

        door10_key: {
            id: 'door10_key',
            location: '�� 神寺 · 佛像前',
            door: 10,
            text: `你拿起法阵钥匙,看到佛像底座上有一个 <span class="highlight">锁孔</span> 。<br>
            雨越来越大,你必须在被雨淋到之前找到门。<br><br>
            你用钥匙打开佛像底座——<br>
            一扇 <span class="highlight">橙色门</span> 出现!<br><br>
            ✅ 第十扇门通过!`,
            choices: [
                { text: '�� 踏入第十一扇门', nextId: 'door11_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        door10_search: {
            id: 'door10_search',
            location: '�� 神寺 · 偏殿',
            door: 10,
            text: `你在偏殿里找到一本 <span class="item">经书</span> 。<br>
            翻开经书,里面夹着一张纸条:<br>
            <i>“安回头颅,法阵化钥,门在佛像下。”</i><br><br>
            你听到雷声响起,雨要来了。`,
            choices: [
                { text: '�� 回到佛像前', nextId: 'door10_monk' }
            ]
        },

        door10_doll: {
            id: 'door10_doll',
            location: '�� 神寺 · 屋檐下',
            door: 10,
            text: `你触碰晴天娃娃,它突然 <span class="danger">碎裂</span> 。<br>
            天空瞬间乌云密布,大雨倾盆而下。<br><br>
            <span class="danger">�� 你被雨淋到,化为了一滩水。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door10_arrive', action: () => adjustHealth(-60) }
            ]
        },

        // ========== 第十一扇门:以牙还牙 ==========
        door11_arrive: {
            id: 'door11_arrive',
            location: '�� 以牙还牙 · 图书馆',
            door: 11,
            text: `你踏入第十一扇门,来到一座 <span class="highlight">巨大的图书馆</span> 。<br>
            书架之间,立着许多 <span class="danger">木偶人</span> 。<br><br>
            <i>“以牙还牙,以眼还眼。”</i><br><br>
            �� 一个 <span class="npc">女雕像</span> 立在图书馆中央,她的眼睛是 <span class="danger">空的</span> 。<br><br>
            ⚠️ 死亡条件:<span class="danger">木偶人被毁坏</span>`,
            choices: [
                { text: '�� 检查女雕像', nextId: 'door11_statue' },
                { text: '�� 探索图书馆', nextId: 'door11_search' },
                { text: '�� 观察木偶人', nextId: 'door11_puppet' }
            ]
        },

        door11_statue: {
            id: 'door11_statue',
            location: '�� 图书馆 · 女雕像前',
            door: 11,
            text: `你走到女雕像前,她的眼睛似乎在 <span class="danger">看着你</span> 。<br>
            你发现她的手中握着一张 <span class="item">纸条</span> 。<br>
            纸条上写着:<span class="highlight">“门在东北角的书架后面。”</span><br><br>
            你听到身后传来木偶人 <span class="danger">关节转动</span> 的声音。`,
            choices: [
                { text: '�� 前往东北角', nextId: 'door11_corner' },
                { text: '�� 继续观察雕像', nextId: 'door11_statue2' }
            ]
        },

        door11_statue2: {
            id: 'door11_statue2',
            location: '�� 图书馆 · 女雕像前',
            door: 11,
            text: `你仔细观察雕像,发现她的嘴里含着一颗 <span class="item">红色的珠子</span> 。<br>
            你伸手取出珠子,雕像的眼睛突然 <span class="danger">流出血泪</span> 。<br><br>
            你获得 <span class="item">血泪珠</span> 。`,
            choices: [
                { text: '�� 拿着珠子去东北角', nextId: 'door11_corner', action: () => addItem('血泪珠') }
            ]
        },

        door11_search: {
            id: 'door11_search',
            location: '�� 图书馆 · 书架间',
            door: 11,
            text: `你在书架间穿行,发现一本 <span class="item">古籍</span> 。<br>
            翻开古籍,里面夹着一片 <span class="item">干枯的树叶</span> 。<br>
            树叶上写着:<i>“东北角,书架后,门自现。”</i><br><br>
            你听到木偶人开始 <span class="danger">移动</span> 。`,
            choices: [
                { text: '�� 前往东北角', nextId: 'door11_corner' }
            ]
        },

        door11_puppet: {
            id: 'door11_puppet',
            location: '�� 图书馆 · 木偶人前',
            door: 11,
            text: `你走到一个木偶人面前,它的眼睛突然 <span class="danger">转动</span> 。<br>
            它开口了:<span class="npc">“你…… 是来毁掉我的吗?”</span><br><br>
            你发现木偶人的背后有一个 <span class="highlight">锁孔</span> 。`,
            choices: [
                { text: '�� 用血泪珠打开(需要:血泪珠)', nextId: 'door11_corner', needItem: '血泪珠' },
                { text: '�� “我不是来伤害你的。”', nextId: 'door11_puppet2' },
                { text: '�� 砸碎木偶人', nextId: 'door11_break' }
            ]
        },

        door11_puppet2: {
            id: 'door11_puppet2',
            location: '�� 图书馆 · 木偶人前',
            door: 11,
            text: `木偶人歪着头:<span class="npc">“那你是来…… 找门的?”</span><br>
            <span class="npc">“门在东北角的书架后面,去吧。”</span><br><br>
            它指向图书馆的东北方向。<br>
            你感觉它似乎 <span class="danger">在帮你</span> 。`,
            choices: [
                { text: '�� 前往东北角', nextId: 'door11_corner' }
            ]
        },

        door11_break: {
            id: 'door11_break',
            location: '�� 图书馆 · 木偶人前',
            door: 11,
            text: `你砸碎了木偶人,碎片散落一地。<br>
            突然,所有木偶人同时 <span class="danger">转头</span> 看向你。<br><br>
            它们的嘴里发出同样的声音:<span class="danger">“以牙还牙……”</span><br><br>
            <span class="danger">�� 你被木偶人撕碎了。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door11_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door11_corner: {
            id: 'door11_corner',
            location: '�� 图书馆 · 东北角',
            door: 11,
            text: `你走到图书馆的东北角,这里非常偏僻。<br>
            你推开一个书架,后面出现一扇 <span class="highlight">青色门</span> 。<br><br>
            ✅ 第十一扇门通过!<br><br>
            你听到门后传来 <span class="danger">箱子开合的声音</span> 。`,
            choices: [
                { text: '�� 踏入第十二扇门', nextId: 'door12_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第十二扇门:箱女游戏 ==========
        door12_arrive: {
            id: 'door12_arrive',
            location: '�� 箱女游戏 · 仓库',
            door: 12,
            text: `你踏入第十二扇门,来到一个 <span class="highlight">堆满箱子的仓库</span> 。<br>
            空气中弥漫着 <span class="danger">血腥味</span> 。<br><br>
            <i>“打开箱子…… 或者成为箱子。”</i><br><br>
            �� 你面前有一个 <span class="npc">保险箱</span> ,旁边写着:<span class="danger">“开箱有奖”</span><br><br>
            ⚠️ 死亡条件:<span class="danger">开出箱人/箱女</span>`,
            choices: [
                { text: '�� 打开保险箱', nextId: 'door12_safe' },
                { text: '�� 去厨房找箱子', nextId: 'door12_kitchen' },
                { text: '�� 检查周围的箱子', nextId: 'door12_check' }
            ]
        },

        door12_safe: {
            id: 'door12_safe',
            location: '�� 仓库 · 保险箱前',
            door: 12,
            text: `你打开保险箱,里面有一把 <span class="item">钥匙</span> 和一张纸条。<br>
            纸条上写着:<i>“厨房里的箱子,藏着门。”</i><br><br>
            你拿起钥匙,感觉保险箱里有什么东西在 <span class="danger">蠕动</span> 。`,
            choices: [
                { text: '�� 拿着钥匙去厨房', nextId: 'door12_kitchen', action: () => addItem('箱女钥匙') },
                { text: '�� 检查保险箱里的蠕动物', nextId: 'door12_creep' }
            ]
        },

        door12_creep: {
            id: 'door12_creep',
            location: '�� 仓库 · 保险箱前',
            door: 12,
            text: `你伸手去摸保险箱里的蠕动物——<br>
            你摸到了一个 <span class="danger">冰冷的手指</span> 。<br><br>
            一个 <span class="danger">箱女</span> 从保险箱里爬了出来……<br>
            <span class="danger">�� 你被箱女拖入了保险箱。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door12_arrive', action: () => adjustHealth(-60) }
            ]
        },

        door12_check: {
            id: 'door12_check',
            location: '�� 仓库 · 箱子堆',
            door: 12,
            text: `你检查周围的箱子,发现大多数都是空的。<br>
            但其中一个箱子里传来 <span class="danger">呼吸声</span> 。<br><br>
            你小心翼翼地打开它——<br>
            里面是一个 <span class="danger">活人</span> ,他已经疯了。<br>
            <span class="npc">“别…… 别打开厨房的箱子……”</span>`,
            choices: [
                { text: '�� 去厨房', nextId: 'door12_kitchen' },
                { text: '�� 再检查一个箱子', nextId: 'door12_check2' }
            ]
        },

        door12_check2: {
            id: 'door12_check2',
            location: '�� 仓库 · 箱子堆',
            door: 12,
            text: `你打开另一个箱子,里面是一面 <span class="item">镜子</span> 。<br>
            镜子里映出你的脸——<br>
            但镜子里的你 <span class="danger">在流血</span> 。<br><br>
            你感到一阵眩晕。`,
            choices: [
                { text: '�� 去厨房', nextId: 'door12_kitchen' },
                { text: '�� 拿起镜子', nextId: 'door12_mirror', action: () => addItem('血镜') }
            ]
        },

        door12_mirror: {
            id: 'door12_mirror',
            location: '�� 仓库 · 箱子堆',
            door: 12,
            text: `你拿起镜子,镜中的你突然 <span class="danger">笑了</span> 。<br>
            你感到一股寒意从镜子传到你手上。<br><br>
            你获得了 <span class="item">血镜</span> 。`,
            choices: [
                { text: '�� 去厨房', nextId: 'door12_kitchen' }
            ]
        },

        door12_kitchen: {
            id: 'door12_kitchen',
            location: '�� 厨房 · 箱子前',
            door: 12,
            text: `你来到厨房,看到一个巨大的 <span class="danger">木箱</span> 。<br>
            箱子上挂着一把锁,如果你有 <span class="item">箱女钥匙</span> ,你可以打开它。<br><br>
            你听到箱子里传来 <span class="danger">指甲刮擦声</span> 。`,
            choices: [
                { text: '�� 用箱女钥匙打开(需要:箱女钥匙)', nextId: 'door12_gate', needItem: '箱女钥匙' },
                { text: '�� 强行砸开箱子', nextId: 'door12_smash' },
                { text: '�� 把耳朵贴在箱子上听', nextId: 'door12_listen' }
            ]
        },

        door12_listen: {
            id: 'door12_listen',
            location: '�� 厨房 · 箱子前',
            door: 12,
            text: `你把耳朵贴在箱子上,听到里面传来一个声音:<br>
            <span class="npc">“放我出去…… 放我出去……”</span><br><br>
            你听出那是 <span class="danger">你自己的声音</span> 。<br><br>
            你感到一阵恐惧。`,
            choices: [
                { text: '�� 用箱女钥匙打开(需要:箱女钥匙)', nextId: 'door12_gate', needItem: '箱女钥匙' },
                { text: '�� 强行砸开', nextId: 'door12_smash' }
            ]
        },

        door12_smash: {
            id: 'door12_smash',
            location: '�� 厨房 · 箱子前',
            door: 12,
            text: `你用力砸开箱子——<br>
            里面躺着一个 <span class="danger">箱女</span> ,她睁开眼睛,看着你。<br><br>
            <span class="danger">�� 你开出了箱女,她将你锁进了箱子里。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door12_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door12_gate: {
            id: 'door12_gate',
            location: '�� 厨房 · 门现',
            door: 12,
            text: `你用钥匙打开箱子,里面没有怪物。<br>
            只有一扇 <span class="highlight">黄色门</span> 在箱底静静地等待着你。<br><br>
            ✅ 第十二扇门通过!<br><br>
            <i>你闻到了…… 鱼腥味。</i>`,
            choices: [
                { text: '�� 踏入第十三扇门', nextId: 'door13_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第十三扇门:米诺陶诺斯 ==========
        door13_arrive: {
            id: 'door13_arrive',
            location: '�� 米诺陶诺斯 · 迷宫入口',
            door: 13,
            text: `你踏入第十三扇门,来到一座 <span class="highlight">巨大的迷宫</span> 前。<br>
            空气中弥漫着 <span class="danger">浓烈的鱼腥味</span> 。<br><br>
            <i>“米诺陶诺斯的迷宫…… 进去就再也出不来了。”</i><br><br>
            �� 一个 <span class="npc">鱼人</span> 在入口处徘徊,它的眼睛里没有瞳孔。<br><br>
            ⚠️ 死亡条件:<span class="danger">沾上鱼腥味</span>`,
            choices: [
                { text: '��️ 杀死鱼人', nextId: 'door13_fish', hint: '获得线索' },
                { text: '�� 直接进入迷宫', nextId: 'door13_maze' },
                { text: '�� 观察迷宫入口', nextId: 'door13_entrance' }
            ]
        },

        door13_fish: {
            id: 'door13_fish',
            location: '�� 迷宫入口 · 鱼人前',
            door: 13,
            text: `你与鱼人搏斗,最终将它杀死。<br>
            它的身体里掉出一张 <span class="item">纸条</span> :<br>
            <span class="highlight">“门在厨房里,避开鱼腥味。”</span><br><br>
            你身上沾到了鱼腥味…… 你必须尽快找到门。`,
            choices: [
                { text: '�� 进入迷宫,寻找厨房', nextId: 'door13_maze', action: () => addItem('鱼人纸条') },
                { text: '�� 在入口处寻找其他线索', nextId: 'door13_entrance' }
            ]
        },

        door13_entrance: {
            id: 'door13_entrance',
            location: '�� 迷宫入口',
            door: 13,
            text: `你在迷宫入口处看到一块 <span class="item">石碑</span> 。<br>
            石碑上刻着:<i>“厨房在迷宫中心,但小心…… 米诺陶诺斯在等你。”</i><br><br>
            你听到迷宫里传来 <span class="danger">沉重的脚步声</span> 。`,
            choices: [
                { text: '�� 进入迷宫', nextId: 'door13_maze' }
            ]
        },

        door13_maze: {
            id: 'door13_maze',
            location: '�� 迷宫 · 内部',
            door: 13,
            text: `你走进迷宫,墙壁高耸,回声四起。<br>
            你在岔路口看到两个方向:<br>
            左边有 <span class="danger">鱼腥味</span> ,右边有 <span class="highlight">微光</span> 。<br><br>
            你选择哪条路?`,
            choices: [
                { text: '�� 走左边(鱼腥味的方向)', nextId: 'door13_left' },
                { text: '�� 走右边(微光的方向)', nextId: 'door13_right' }
            ]
        },

        door13_left: {
            id: 'door13_left',
            location: '�� 迷宫 · 左边通道',
            door: 13,
            text: `你走向鱼腥味的方向,通道越来越窄。<br>
            你看到了 <span class="danger">米诺陶诺斯</span> —— 一个牛头人身的怪物!<br><br>
            它闻到了你身上的鱼腥味,向你冲了过来!<br><br>
            <span class="danger">�� 你被米诺陶诺斯撕碎了。</span>`,
            choices: [
                { text: '�� 重新来过', nextId: 'door13_arrive', action: () => adjustHealth(-50) }
            ]
        },

        door13_right: {
            id: 'door13_right',
            location: '�� 迷宫 · 右边通道',
            door: 13,
            text: `你走向微光的方向,通道越来越宽。<br>
            你走到了迷宫的中心—— 一间 <span class="highlight">厨房</span> 。<br><br>
            你看到灶台下面有一扇 <span class="highlight">棕色门</span> 。<br><br>
            ✅ 第十三扇门通过!<br><br>
            <i>最后一扇门…… 在等你。</i>`,
            choices: [
                { text: '�� 踏入第十四扇门', nextId: 'door14_arrive', action: () => { state.doors += 1; state.shards += 2; adjustHealth(5); } }
            ]
        },

        // ========== 第十四扇门:无解 · 生死 ==========
        door14_arrive: {
            id: 'door14_arrive',
            location: '�� 最终门 · 时钟前',
            door: 14,
            text: `你踏入第十四扇门,也是 <span class="highlight">最后一扇门</span> 。<br>
            你站在一个 <span class="highlight">巨大的时钟</span> 面前,指针在 <span class="danger">倒转</span> 。<br><br>
            <i>“无解之门,生死由天。”</i><br><br>
            �� 你看到时钟下方刻着一行字:<br>
            <span class="highlight">“时间,是唯一的答案。”</span><br><br>
            你身后站着 <span class="npc">阮南烛</span> 。<br>
            <span class="npc">“秋石…… 你终于走到这里了。”</span>`,
            choices: [
                { text: '�� 拨动时钟指针', nextId: 'door14_clock' },
                { text: '�� 与阮南烛对话', nextId: 'door14_ruan' },
                { text: '�� 直接推开门', nextId: 'door14_final' }
            ]
        },

        door14_ruan: {
            id: 'door14_ruan',
            location: '�� 最终门 · 时钟前',
            door: 14,
            text: `你转身看向阮南烛,他微笑着看着你。<br>
            <span class="npc">“你记得所有门里的规则,你通过了每一扇门。”</span><br>
            <span class="npc">“但最后一扇门…… 没有规则。”</span><br>
            <span class="npc">“因为门里,是你自己的选择。”</span><br><br>
            他指向时钟:<span class="npc">“拨动它,或者推开门。”</span>`,
            choices: [
                { text: '�� 拨动时钟指针', nextId: 'door14_clock' },
                { text: '�� 推开门', nextId: 'door14_final' }
            ]
        },

        door14_clock: {
            id: 'door14_clock',
            location: '�� 最终门 · 时钟前',
            door: 14,
            text: `你伸手拨动时钟的指针,将它拨回了 <span class="highlight">起点</span> 。<br>
            钟声响起,回荡在虚空中。<br><br>
            阮南烛的声音在你耳边响起:<span class="npc">“时间倒流…… 一切重新开始。”</span><br><br>
            你面前的钟面裂开,露出一扇 <span class="highlight">纯白之门</span> 。<br><br>
            ✅ 第十四扇门通过!<br><br>
            <i>“你走出了死亡万花筒。”</i>`,
            choices: [
                { text: '�� 推开纯白之门', nextId: 'door14_final', action: () => { state.shards += 5; state.memories += 3; } }
            ]
        },

        door14_final: {
            id: 'door14_final',
            location: '�� 终点 · 门后世界',
            door: 14,
            text: `你推开门,光芒吞没了一切。<br><br>
            <span class="highlight">“欢迎回来,秋石。”</span><br><br>
            你看到阮南烛站在门后,向你伸出手。<br><br>
            <i>你终于走出了十四扇门。</i><br>
            <i>但万花筒的碎片…… 永远留在你的记忆里。</i><br><br>
            ★ 死亡万花筒 · 全剧本通关 ★<br><br>
            �� 你完成了所有副本!`,
            choices: [
                { text: '�� 重新开始轮回', nextId: 'start', action: () => { resetGame(); } }
            ]
        }
    };

    // ---------- 引擎核心 ----------
    function goToNode(id, action) {
        if (action) action();
        if (story[id]) {
            state.currentId = id;
            // 记录访问
            if (!state.visited.includes(id)) state.visited.push(id);
            updateUI();
        } else {
            showNotification('⚠️ 剧情节点不存在,返回起点');
            state.currentId = 'start';
            updateUI();
        }
    }

    function resetGame() {
        state = {
            currentId: 'start',
            shards: 0,
            doors: 1,
            memories: 0,
            health: 100,
            inventory: [],
            flags: {},
            visited: [],
            choices: []
        };
        updateUI();
        showNotification('�� 万花筒已重启');
    }

    // ---------- UI渲染 ----------
    function updateUI() {
        const node = story[state.currentId];
        if (!node) {
            document.getElementById('sceneText').innerHTML = '碎片散落,你迷失在万花筒中……';
            document.getElementById('choiceContainer').innerHTML = '';
            return;
        }

        // 状态
        document.getElementById('shardDisplay').textContent = state.shards;
        document.getElementById('doorDisplay').textContent = state.doors;
        document.getElementById('memoryDisplay').textContent = state.memories;
        document.getElementById('healthDisplay').textContent = state.health;

        // 位置 & 门号
        document.getElementById('locationDisplay').textContent = node.location || '�� 未知';
        document.getElementById('doorCounter').textContent = node.door > 0 ? `�� 第 ${node.door} / 14 扇门` : '�� 万花筒起点';

        // 场景文字
        document.getElementById('sceneText').innerHTML = node.text;

        // 背包
        const invContainer = document.getElementById('inventoryContainer');
        if (state.inventory.length === 0) {
            invContainer.innerHTML = '<span class="empty-inv">空</span>';
        } else {
            invContainer.innerHTML = state.inventory.map(item => 
                `<span class="inv-item"><span class="item-icon">✦</span>${item}</span>`
            ).join('');
        }
        document.getElementById('invCount').textContent = `${state.inventory.length} 件`;

        // 选项
        const choiceContainer = document.getElementById('choiceContainer');
        if (!node.choices || node.choices.length === 0) {
            choiceContainer.innerHTML = `<div style="color:#604060;text-align:center;padding:20px;font-style:italic;">门已关闭……</div>`;
            return;
        }

        let html = '';
        const letters = ['A', 'B', 'C', 'D', 'E', 'F'];
        node.choices.forEach((choice, index) => {
            const letter = letters[index] || '?';
            let isDisabled = false;
            let extraClass = '';

            // 检查道具需求
            if (choice.needItem) {
                if (!hasItem(choice.needItem)) {
                    isDisabled = true;
                    extraClass = ' disabled';
                } else {
                    extraClass = ' required-item';
                }
            }

            html += `
                <div class="choice-btn${extraClass}" data-index="${index}" data-disabled="${isDisabled}">
                    <span class="choice-letter">${letter}</span>
                    <div class="choice-desc">
                        ${choice.text}
                        ${choice.hint ? `<span class="choice-hint">�� ${choice.hint}</span>` : ''}
                        ${choice.needItem ? `<span class="choice-hint">�� 需要:${choice.needItem}</span>` : ''}
                    </div>
                </div>
            `;
        });

        choiceContainer.innerHTML = html;

        // 绑定点击事件
        document.querySelectorAll('.choice-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                if (this.dataset.disabled === 'true') {
                    showNotification('⚠️ 你需要先获得所需道具');
                    return;
                }
                const idx = parseInt(this.dataset.index);
                const choice = node.choices[idx];
                if (!choice) return;

                // 执行动作
                if (choice.action) choice.action();

                // 跳转
                if (choice.nextId && story[choice.nextId]) {
                    state.currentId = choice.nextId;
                    updateUI();
                } else {
                    showNotification('⚠️ 门暂时关闭,请重试');
                }
            });
        });
    }

    // ---------- 提示功能 ----------
    let hintIndex = 0;
    const hints = [
        '�� 注意观察场景中的道具和线索',
        '�� 某些选项需要特定道具才能选择',
        '�� 理智值太低会影响剧情走向',
        '�� 多与NPC对话,他们会给你线索',
        '�� 每个副本都有独特的死亡条件,小心规避',
        '�� 背包里的道具可以在关键时刻使用',
        '�� 有些门需要特殊钥匙才能打开'
    ];

    function showHint() {
        const hint = hints[hintIndex % hints.length];
        showNotification(hint);
        hintIndex++;
    }

    // ---------- 分享 ----------
    function shareGame() {
        const node = story[state.currentId];
        const shareText = 
            `✦ 死亡万花筒 · 沉浸式剧本杀 ✦\n` +
            `当前:${node ? node.location : '未知'}\n` +
            `碎片:${state.shards} | 门:${state.doors} | 记忆:${state.memories}\n` +
            `背包:${state.inventory.length > 0 ? state.inventory.join('、') : '空'}\n` +
            `—— 西子绪原著 · 十四门全剧本 ——`;

        if (navigator.share) {
            navigator.share({
                title: '死亡万花筒 · 沉浸式剧本杀',
                text: shareText,
                url: window.location.href,
            }).catch(err => {
                if (err.name !== 'AbortError') fallbackShare(shareText);
            });
        } else {
            fallbackShare(shareText);
        }
    }

    function fallbackShare(text) {
        const fullText = text + '\n' + window.location.href;
        if (navigator.clipboard && navigator.clipboard.writeText) {
            navigator.clipboard.writeText(fullText).then(() => {
                showNotification('✅ 已复制分享内容!');
            }).catch(() => {
                prompt('复制以下内容分享:', fullText);
            });
        } else {
            prompt('复制以下内容分享:', fullText);
        }
    }

    // ---------- 初始化 ----------
    document.getElementById('resetBtn').addEventListener('click', resetGame);
    document.getElementById('shareBtn').addEventListener('click', shareGame);
    document.getElementById('hintBtn').addEventListener('click', showHint);

    resetGame();

})();
</script>
</body>
</html>
console 命令行工具 X clear

                    
>
console