/* === 全局基础 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: #000; font-family: "Songti SC", "SimSun", sans-serif; overflow: hidden; }
.hidden { display: none !important; }

/* 落地页 */
#landing-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.9)), url('assets/bg_banquet.jpg'); background-size: cover; background-position: center; z-index: 2000; display: flex; justify-content: center; align-items: center; color: #fff; transition: opacity 0.5s; }
.landing-content { text-align: center; width: 80%; }
.logo-box { margin-bottom: 20px; animation: float 3s infinite; }
.main-logo { width: 100px; height: auto; }
.brand-name { font-size: 32px; color: #f1c40f; margin-bottom: 10px; }
.brand-slogan { font-size: 14px; color: #ccc; margin-bottom: 40px; border-top: 1px solid #555; padding-top: 10px; display: inline-block; }
.counter-box { margin-bottom: 40px; font-size: 14px; color: #888; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 20px; display: inline-block;}
#visitor-count { color: #c0392b; font-weight: bold; margin: 0 5px; }
.enter-btn { background: transparent; border: 2px solid #8B0000; color: #8B0000; padding: 10px 40px; font-size: 18px; cursor: pointer; transition: 0.3s; font-weight: bold; }
.enter-btn:hover { background: #8B0000; color: #fff; box-shadow: 0 0 15px #8B0000; }

/* 菜单与门禁 */
#menu-layer { width: 100%; height: 100vh; max-width: 480px; margin: 0 auto; background-image: url('assets/bg_paper.jpg'); background-size: cover; overflow-y: auto; padding: 20px; }
.studio-header { text-align: center; margin-bottom: 20px; border-bottom: 2px solid #5d4037; padding-bottom: 10px; }
.studio-title-small { font-size: 24px; color: #3e2723; font-weight: bold; }

.script-card { background: rgba(255,255,255,0.7); border: 1px solid #8B0000; border-radius: 8px; margin-bottom: 20px; display: flex; overflow: hidden; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.script-card.locked { opacity: 0.6; filter: grayscale(1); cursor: default; border-color: #999; }
.card-cover { width: 100px; height: 133px; position: relative; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: 0; left: 0; background: #c0392b; color: white; font-size: 10px; padding: 2px 6px; }
.card-info { padding: 10px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.select-btn { margin-top: 8px; background: #333; color: #d4af37; border: none; padding: 4px 10px; border-radius: 4px; align-self: flex-start; }

#lock-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.9); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.lock-container { width: 85%; max-width: 350px; background: #fff; padding: 20px; border-radius: 10px; text-align: center; border: 2px solid #8B0000; position: relative;}
.close-lock { position: absolute; top: -40px; right: 0; color: #fff; font-size: 30px; cursor: pointer; }
.pay-box { background: #f8f8f8; padding: 10px; margin: 15px 0; border: 1px dashed #ccc; }
.qr-code { width: 120px; height: 120px; }
.input-box { display: flex; gap: 5px; }
#password-input { flex: 1; padding: 8px; border: 1px solid #ccc; }
.input-box button { background: #8B0000; color: white; border: none; padding: 0 15px; cursor: pointer; }

/* 游戏容器 */
#game-container { width: 100%; height: 100vh; max-width: 480px; margin: 0 auto; position: relative; background: #000; overflow: hidden; }

/* Story Mode */
#story-mode-layer { width: 100%; height: 100%; position: relative; }
#background-layer { width: 100%; height: 100%; background-size: cover; background-position: center; transition: background-image 0.5s; }

#character-layer { 
    position: absolute; bottom: 180px; left: 50%; transform: translateX(-50%); 
    height: 55%; pointer-events: none; z-index: 5; display: flex; align-items: flex-end; justify-content: center;
}
#character-img { 
    height: 100%; width: auto; max-width: 90vw; object-fit: contain;
    border-radius: 10px; border: 3px solid #d4af37; box-shadow: 0 5px 15px rgba(0,0,0,0.5); background-color: #f0f0f0; 
}

#dialogue-box { position: absolute; bottom: 0; width: 100%; height: 180px; background: rgba(0,0,0,0.9); border-top: 2px solid #8B0000; padding: 20px; color: #fff; z-index: 10;}
#speaker-name { color: #e74c3c; margin-bottom: 5px; font-weight: bold; font-size: 18px; }
#dialogue-text { font-size: 16px; line-height: 1.6; }
#next-btn { position: absolute; bottom: 10px; right: 20px; animation: blink 1s infinite; cursor: pointer; color: #f1c40f; font-size: 18px;}

#story-options { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 20; }
.option-btn { width: 80%; padding: 15px; margin: 10px 0; background: #c0392b; color: white; border: 1px solid #e74c3c; text-align: center; border-radius: 5px; cursor: pointer; font-size: 16px; }

#clue-popup { position: absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index: 100; display: flex; justify-content: center; align-items: center; }
.clue-content { width: 75%; background: #fff; padding: 25px; border-radius: 10px; text-align: center; border: 3px solid #f1c40f; box-shadow: 0 0 20px #f1c40f; }
.clue-content h3 { color: #8B0000; margin-bottom: 10px; }
.clue-content p { color: #333; margin-bottom: 25px; font-weight: bold; font-size: 15px; line-height: 1.5; }
.clue-content button { background: #8B0000; color: #fff; border:none; padding:10px 20px; border-radius:5px; cursor:pointer; font-size: 16px; }

/* Chat Mode */
#chat-mode-layer { width: 100%; height: 100%; background: #f5f5f5; display: flex; flex-direction: column; font-family: sans-serif; z-index: 50; position: relative;}
.chat-header { height: 50px; background: #1a1a1a; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; font-weight: bold; z-index: 5;}
.exit-btn { background: none; border: 1px solid #666; color: #ccc; padding: 2px 8px; border-radius: 4px; font-size: 12px; cursor: pointer;}
#chat-history { flex: 1; overflow-y: auto; padding: 15px; background: #ebebeb; display: flex; flex-direction: column; gap: 15px; }

.message { display: flex; align-items: flex-start; max-width: 85%; }
.message.me { align-self: flex-end; flex-direction: row-reverse; }
.message.other { align-self: flex-start; }
.message.system { align-self: center; max-width: 90%; margin: 10px 0; }

.avatar { width: 40px; height: 40px; border-radius: 5px; overflow: hidden; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.1); background: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-content { background: #fff; padding: 10px; border-radius: 5px; margin: 0 10px; font-size: 14px; line-height: 1.5; color: #333; position: relative; }
.message.me .msg-content { background: #95ec69; color: #000; }
.message.system .msg-content { background: #dcdcdc; color: #666; font-size: 12px; padding: 3px 10px; border-radius: 20px; text-shadow: none; }
.msg-img { max-width: 150px; max-height: 150px; border-radius: 5px; display: block; margin-bottom: 5px; border: 1px solid #ccc; background: #fff;}

.msg-name { font-size: 12px; color: #999; margin-bottom: 2px; margin-left: 10px; }
.message.me .msg-name { text-align: right; margin-right: 10px; }

.chat-controls { height: 60px; background: #f7f7f7; border-top: 1px solid #ddd; display: flex; align-items: center; justify-content: space-around; z-index: 5;}
.control-btn { flex: 1; text-align: center; height: 100%; line-height: 60px; font-size: 16px; color: #333; font-weight: bold; cursor: pointer; border-right: 1px solid #eee;}
.control-btn:last-child { border-right: none; }
.control-btn:active { background: #e5e5e5; }
.control-btn.red { color: #c0392b; }

#chat-options-panel { position: absolute; bottom: 0; width: 100%; height: 50%; background: #fff; border-top-left-radius: 15px; border-top-right-radius: 15px; box-shadow: 0 -5px 20px rgba(0,0,0,0.3); z-index: 100; display: flex; flex-direction: column; transition: transform 0.3s ease-out;}
#chat-options-panel.hidden { transform: translateY(100%); }
.panel-header { padding: 15px; border-bottom: 1px solid #eee; font-weight: bold; color: #333; background: #f9f9f9; border-radius: 15px 15px 0 0;}
#chat-options-list { flex: 1; overflow-y: auto; padding: 0; }
.chat-opt-btn { width: 100%; padding: 15px; border-bottom: 1px solid #f0f0f0; text-align: left; font-size: 15px; cursor: pointer; font-family: sans-serif;}

@keyframes float { 0% {transform: translateY(0px);} 50% {transform: translateY(-10px);} 100% {transform: translateY(0px);} }
@keyframes blink { 0% {opacity: 1;} 50% {opacity: 0.3;} 100% {opacity: 1;} }