/* 动画效果 */

/* 场景切换淡入淡出 */
.scene-fade-in {
  animation: sceneFadeIn 0.8s forwards;
}

@keyframes sceneFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scene-fade-out {
  animation: sceneFadeOut 0.5s forwards;
}

@keyframes sceneFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 人物入场 */
.character-enter-left {
  animation: enterLeft 0.5s forwards;
}

@keyframes enterLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.character-enter-right {
  animation: enterRight 0.5s forwards;
}

@keyframes enterRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.character-enter-center {
  animation: enterCenter 0.5s forwards;
}

@keyframes enterCenter {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* 人物离场 */
.character-exit-left {
  animation: exitLeft 0.5s forwards;
}

@keyframes exitLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

.character-exit-right {
  animation: exitRight 0.5s forwards;
}

@keyframes exitRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* 屏幕震动 */
.screen-shake {
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-5px, 5px); }
  50% { transform: translate(5px, -5px); }
  75% { transform: translate(-5px, -5px); }
}

/* 闪光效果 */
.screen-flash {
  animation: flash 0.3s;
}

@keyframes flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(2); }
  100% { filter: brightness(1); }
}

/* 文字淡入 */
.text-fade-in {
  animation: textFadeIn 0.3s forwards;
}

@keyframes textFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* History Pause 动画 */
.history-pause-enter {
  animation: historyPauseEnter 0.5s forwards;
}

@keyframes historyPauseEnter {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 选项按钮悬停 */
.choice-btn {
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.2), transparent);
  transition: left 0.5s;
}

.choice-btn:hover::before {
  left: 100%;
}

/* 变量变化提示 */
.variable-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--sepia-mid);
  border: 2px solid var(--gold);
  padding: 10px 20px;
  border-radius: 8px;
  z-index: 300;
  animation: popupSlide 0.3s forwards, popupFade 0.3s 1.5s forwards;
}

@keyframes popupSlide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes popupFade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.variable-popup.positive {
  border-color: #4caf50;
  color: #4caf50;
}

.variable-popup.negative {
  border-color: #f44336;
  color: #f44336;
}
