:root { --color-primary: #111; --color-accent: #e84393; --color-bg: #f4f5f7; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
body { background: #0a0a0a; font-family: -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; overflow: hidden; }

#device-container { width: 100%; max-width: 390px; height: 100%; background: #ffffff; position: relative; overflow: hidden; }
@media (min-width: 400px) { #device-container { height: 90vh; border-radius: 40px; border: 12px solid #222; box-shadow: 0 10px 40px rgba(0,0,0,0.5); } }

.view-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; background: #fff; }
.active-view { display: flex; z-index: 10; }
.hidden-view, .hidden-element { display: none !important; }

#screen-launch { background: linear-gradient(135deg, #fdfbfb, #ebedee); justify-content: center; align-items: center; text-align: center; }
.logo-text { font-size: 38px; font-weight: 800; color: #111; margin-bottom: 10px; letter-spacing: -1px; }
.sub-text { font-size: 14px; color: #666; margin-bottom: 40px; }

.header-bar { padding: 40px 20px 15px; font-size: 18px; font-weight: 600; text-align: center; border-bottom: 1px solid #eaeaea; }
.scroll-container { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.padding-20 { padding: 20px; } .padding-15 { padding: 15px; } .mt-20 { margin-top: 20px; } .mt-10 { margin-top: 10px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; color: #888; margin-bottom: 8px; font-weight: 500; }
input[type="text"] { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 12px; font-size: 15px; outline: none; }
.tag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tag { padding: 12px; background: #f8f9fa; border: 1px solid #eee; border-radius: 10px; text-align: center; font-size: 13px; cursor: pointer; transition: 0.2s; }
.tag.active { background: #111; border-color: #111; color: #fff; font-weight: bold; }

.btn-primary, .btn-secondary { width: 100%; padding: 16px; border-radius: 12px; font-size: 16px; font-weight: bold; cursor: pointer; border: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: #f0f0f0; color: #333; }

.top-status-bar { display: flex; justify-content: space-between; padding: 45px 15px 10px; background: #fff; border-bottom: 1px solid #eee; }
.stat-item { font-size: 12px; font-weight: 600; color: #333; }
.stat-item span { color: var(--color-accent); }

.chat-header { padding: 12px 20px; background: #fff; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eaeaea; }
.scene-badge { font-size: 11px; background: #f0f0f0; color: #333; padding: 4px 10px; border-radius: 12px; font-weight: bold; }
#chat-target-name { font-size: 14px; font-weight: 600; color: #666; }
.chat-status { font-size: 11px; color: #4CAF50; }

.bg-chat { background: var(--color-bg); display: flex; flex-direction: column; gap: 16px; }
.action-container { padding: 15px; background: #fff; border-top: 1px solid #eaeaea; display: flex; flex-direction: column; gap: 10px; }
.btn-choice { width: 100%; padding: 14px; background: #fff; border: 1px solid #ddd; border-radius: 12px; font-size: 14px; color: #111; text-align: left; cursor: pointer; transition: 0.2s; line-height: 1.4; }
.btn-choice:active { background: #f0f0f0; }
.btn-choice.locked { background: #f9f9f9; color: #aaa; cursor: not-allowed; border-style: dashed; }

.msg-wrapper { display: flex; flex-direction: column; width: 100%; animation: fadeIn 0.3s ease forwards; }
.bubble { max-width: 80%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.msg-left { align-items: flex-start; } .msg-left .bubble { background: #fff; border-top-left-radius: 4px; border: 1px solid #eee; }
.msg-right { align-items: flex-end; } .msg-right .bubble { background: #111; color: #fff; border-top-right-radius: 4px; }
.sys-hint { align-self: center; background: rgba(0,0,0,0.05); color: #666; font-size: 12px; padding: 6px 14px; border-radius: 12px; margin: 10px 0; text-align: center;}

/* 手机弹窗 */
.phone-overlay { position: absolute; bottom: 0; left: 0; width: 100%; height: 85%; background: #f4f5f7; z-index: 100; border-top-left-radius: 20px; border-top-right-radius: 20px; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); display: flex; flex-direction: column; animation: slideUp 0.3s ease forwards; }
.phone-header { padding: 15px 20px; background: #fff; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; border-top-left-radius: 20px; border-top-right-radius: 20px; }
#phone-title { font-weight: bold; font-size: 16px; }
.phone-close { color: #e84393; font-size: 13px; cursor: pointer; font-weight: bold; }
.phone-body { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px; }

.typing-indicator { font-size: 12px; color: #888; align-self: flex-start; margin-bottom: 10px; animation: pulse 1s infinite; }
.moments-card { background: #fff; padding: 15px; border-radius: 12px; border: 1px solid #eee; }
.moments-header { display: flex; align-items: center; margin-bottom: 10px; font-weight: bold; font-size: 14px; }
.moments-time { font-size: 11px; color: #999; margin-left: auto; font-weight: normal; }
.moments-actions { display: flex; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0; }
.moments-btn { flex: 1; text-align: center; font-size: 13px; padding: 8px; background: #f8f9fa; border-radius: 8px; cursor: pointer; font-weight: bold; }
.hot-search-alert { background: #fff; padding: 20px; border-radius: 16px; border: 2px solid #ff4757; text-align: center; }
.hot-level { color: #ff4757; font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.timer-bar { height: 4px; background: #ff4757; width: 100%; transition: width 1s linear; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
/* 数值变动实时浮窗 */
.toast-msg {
    position: fixed; 
    top: 30%; 
    left: 50%; 
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75); 
    color: #fff; 
    padding: 10px 24px; 
    border-radius: 20px;
    font-size: 14px; 
    font-weight: bold;
    z-index: 9999; 
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: toastFade 2.5s forwards;
    white-space: nowrap;
}
@keyframes toastFade {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -15px); }
}
/* ====== 强制覆盖：原汁原味微信 UI ====== */

/* 1. 聊天大背景改为微信专属浅灰色 */
.bg-chat {
    background-color: #ededed !important; 
}

/* 2. 玩家（右侧）气泡改成微信绿，文字变黑 */
.msg-right .bubble {
    background-color: #95ec69 !important;
    color: #111 !important;
}

/* 3. 玩家右侧气泡的小尖角也改成微信绿 */
.msg-right .bubble::before {
    border-left-color: #95ec69 !important;
}

/* 4. NPC（左侧）气泡强制纯白，带点微弱的阴影 */
.msg-left .bubble {
    background-color: #ffffff !important;
    color: #111 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* 5. 左侧气泡的小尖角也改成白色 */
.msg-left .bubble::before {
    border-right-color: #ffffff !important;
}
