/* ========== 全局重置与基础 ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 全局配色系统 */
    --primary: #ff6b6b;
    --primary-dark: #ee5a24;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #f0f2f5;
    --text-light: #ffffff;
    --text-dark: #2d3436;
    --text-gray: #636e72;
    --border-light: #dfe6e9;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    /* 字体与尺寸 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'Courier New', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 主场景容器：全屏居中，模拟设备 */
.scene-container {
    width: 100%;
    max-width: 480px;      /* 手机端宽度 */
    min-height: 100vh;
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 auto;
}

/* 电脑端适配：稍宽一些的居中卡片 */
@media (min-width: 768px) {
    .scene-container {
        max-width: 900px;
        min-height: 85vh;
        margin: 2rem auto;
        border-radius: 24px;
        background: #ffffff;
    }
}

/* 全局按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--primary);
    color: white;
    text-decoration: none;
    transform: scale(1);
    user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* 输入框全局样式 */
.input-field {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 16px;
    background: white;
    transition: var(--transition);
    outline: none;
    font-family: var(--font-mono);
    letter-spacing: 2px;
}
.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

/* 全局弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.25s ease;
}
.modal-box {
    background: white;
    border-radius: 20px;
    padding: 30px 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: scaleIn 0.3s ease;
}
.modal-box h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--bg-dark);
}
.modal-box p {
    color: var(--text-gray);
    margin-bottom: 20px;
    font-size: 15px;
}

/* 剧情/提示浮动条 */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: white;
    padding: 14px 24px;
    border-radius: 40px;
    font-weight: 500;
    z-index: 10000;
    animation: slideDown 0.4s ease, fadeOut 0.3s 2.2s forwards;
    white-space: nowrap;
}

/* 页面切换过渡 */
.page-enter {
    animation: fadeInUp 0.4s ease;
}

/* 动画定义 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideDown { from { transform: translateX(-50%) translateY(-80px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 工具类 */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }