:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg-dark: #0f172a;
    --bg-light: #1e1b4b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255,255,255,0.1);
    
    --hp-color: #ef4444;
    --mp-color: #3b82f6;
    --exp-color: #f59e0b;
    
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
    --radius: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    color: var(--text);
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    touch-action: manipulation;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

#game-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-y: auto;
}

/* 场景系统 */
.scene {
    position: absolute;
    width: 100%;
    min-height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    -webkit-overflow-scrolling: touch;
}

.scene.active {
    display: flex;
    opacity: 1;
}

/* 动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes soundWave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    50% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

.shake { animation: shake 0.5s ease-in-out; }
.floating { animation: float 3s ease-in-out infinite; }

/* 工具类 */
.hidden { display: none !important; }
.text-center { text-align: center; }