/* ================= 马六甲风格：大屏优化 ================= */
body {
    /* 深海蓝背景，带有微弱的宋锦纹理感（使用渐变模拟） */
    background-color: #003366;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 215, 0, 0.05) 10px, rgba(255, 215, 0, 0.05) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255, 215, 0, 0.05) 10px, rgba(255, 215, 0, 0.05) 20px);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    margin: 0; padding: 0;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; font-weight: 900;
}

.panel {
    /* 内部面板，带有木雕质感 */
    background: #f4ecd8;
    background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(200,180,140,0.2) 100%);
    border: 15px solid #4a2e15; /* 深木色 */
    border-style: ridge; /* 木雕边框感 */
    width: 95vw; max-width: 1300px;
    height: 92vh; padding: 40px;
    box-shadow: 0 0 100px rgba(0,0,0,0.8), inset 0 0 30px rgba(74, 46, 21, 0.5);
    display: none; flex-direction: column;
    box-sizing: border-box; border-radius: 10px;
    position: relative;
}

.panel.active { display: flex; }

h1 { font-size: 3.8em; color: #003366; text-align: center; margin: 5px 0; text-shadow: 3px 3px 0px #FFD700; }
h2 { font-size: 2.5em; color: #4a2e15; text-align: center; margin: 5px 0; }

#story-text {
    font-size: 2.1em; line-height: 1.4;
    margin: 10px 0; background: rgba(255, 255, 255, 0.6);
    padding: 20px; border-radius: 10px;
    border-left: 20px solid #003366;
    overflow-y: auto; color: #1a1a1a;
    flex: 1;
    min-height: 150px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.choice-btn, .sys-btn {
    background: #003366; color: #FFD700;
    font-size: 1.8em; font-weight: 900;
    padding: 25px; border: 5px solid #FFD700;
    cursor: pointer; border-radius: 15px;
    margin: 10px 0; width: 100%;
    box-shadow: 0 8px 0 #001a33;
    transition: all 0.2s;
    text-shadow: 1px 1px 2px #000;
}
.choice-btn:hover, .sys-btn:hover { background: #004080; transform: scale(1.01); }
.choice-btn:active, .sys-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #001a33; }

#status-bar {
    background: #003366; color: #FFD700;
    padding: 15px 30px; display: flex;
    justify-content: space-between; font-size: 1.8em;
    border-radius: 10px; margin-bottom: 10px;
    border: 3px solid #FFD700;
    text-shadow: 1px 1px 2px #000;
}

#ai-area {
    display: none; flex-direction: column;
    background: #fff; border: 6px solid #003366;
    padding: 15px; border-radius: 15px; 
    height: 380px; 
    margin-top: 10px; 
    position: relative;
}
#chat-box {
    flex-grow: 1; overflow-y: auto;
    font-size: 1.6em; padding: 10px; background: #fdfdfd;
    border-bottom: 3px solid #eee;
}
.msg { margin: 10px 0; padding: 15px; border-radius: 8px; border: 2px solid transparent; }
.king-msg, .msg.king { background: #e6f0ff; color: #003366; border-color: #003366; }
.player-msg, .msg.user { background: #fff5cc; color: #4a2e15; text-align: right; border-color: #FFD700; }

.group-input { font-size: 2em; width: 80%; padding: 15px; text-align: center; border: 5px solid #003366; border-radius: 10px; }

#vol-ctrl { 
    position: fixed; top: 10px; left: 10px; 
    background: rgba(255,255,255,0.95); padding: 15px; 
    border: 3px solid #003366; z-index: 1000;
    border-radius: 10px; box-shadow: 5px 5px 0 #FFD700;
}
.vol-item { margin-bottom: 10px; font-size: 1.2em; font-weight: bold; color: #003366; }

.highlight { color: #cc0000; font-size: 1.1em; }

.back-hall-btn {
    position: absolute; top: -50px; right: 10px;
    background: #FFD700; color: #003366; padding: 5px 15px;
    border-radius: 10px; font-size: 1.2em; cursor: pointer;
    border: 2px solid #003366;
    font-weight: bold;
}

#choice-area {
    max-height: 40%;
    overflow-y: auto;
}

#custom-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 51, 102, 0.95); color: #FFD700; padding: 15px 30px;
    border-radius: 8px; z-index: 9999; font-size: 1.5em; border: 2px solid #FFD700;
    display: none; text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#scene-img-area {
    width: 100%;
    text-align: center;
    margin: 15px 0;
    min-height: 100px;
}

.ending-meta {
    margin-top: 10px;
    font-size: 1.2em;
    opacity: 0.9;
    color: #4a2e15;
}
.ending-body {
    margin-top: 12px;
    font-size: 1.8em;
    line-height: 1.4;
    background: rgba(255, 215, 0, 0.15);
    padding: 15px 18px;
    border-radius: 10px;
    border-left: 12px solid #003366;
}
.ending-role {
    margin-top: 12px;
    font-size: 1.5em;
    font-weight: 900;
    color: #003366;
}
.ending-key {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #003366;
    color: #FFD700;
    font-weight: 900;
}
.ending-tip {
    margin-top: 12px;
    font-size: 1.2em;
    opacity: 0.85;
}

.scene-img {
    max-width: 100%;
    max-height: 400px;
    border: 8px solid #4a2e15; /* 木色画框 */
    border-radius: 15px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.3s;
    object-fit: cover;
}
.scene-img:hover {
    transform: scale(1.05);
}

/* 卷轴式弹窗说明 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 2000;
    display: none; justify-content: center; align-items: center;
}
.modal-content {
    background: #f4ecd8;
    background-image: url('https://www.transparenttextures.com/patterns/aged-paper.png');
    border: 10px solid #4a2e15; border-style: ridge;
    width: 80%; max-width: 800px; max-height: 80vh;
    padding: 30px; border-radius: 5px; overflow-y: auto;
    box-shadow: 0 0 50px #000; color: #4a2e15;
    position: relative; font-family: 'STKaiti', 'Kaiti SC', serif;
}
.modal-close {
    position: sticky; top: 0; float: right;
    background: #cc0000; color: #fff; border: none;
    padding: 5px 15px; cursor: pointer; font-weight: bold;
    border-radius: 5px; font-size: 1.2em;
}
.modal-content h3 { color: #003366; border-bottom: 2px solid #003366; padding-bottom: 10px; margin-top: 0; }
.modal-content p, .modal-content li { font-size: 1.4em; line-height: 1.6; }

