/* ========================================
   全局样式 - 布局、变量、基础重置
   ======================================== */

:root {
    --color-bg:       #1a1a2e;
    --color-surface:  #16213e;
    --color-primary:  #e94560;
    --color-text:     #eaeaea;
    --color-text-dim: #888;
    --color-border:   #333;
    --font-main:      'Microsoft YaHei', 'PingFang SC', sans-serif;
    --radius:         8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    user-select: none;
    -webkit-user-select: none;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ========== 导航栏 ========== */
#nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.nav-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary);
}

.nav-btns {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 6px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.nav-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ========== 场景容器 ========== */
#scene-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.scene {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 飘字动画 ========== */
.floating-text {
    font-weight: bold;
    font-size: 24px;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.floating-text.damage {
    color: #ff4444;
}

.floating-text.heal {
    color: #44ff44;
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, calc(-50% - 60px)); }
}

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: bold;
    z-index: 9999;
    pointer-events: none;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.5s forwards;
    background: rgba(200, 30, 30, 0.92);
    color: #fff;
    border: 1px solid #ff4444;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

@keyframes toastIn {
    0%   { opacity: 0; transform: translateX(-50%) translateY(20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    0%   { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
