/**
 * style.css - 游戏样式
 * 包含：主菜单、游戏主界面、通用组件样式
 */

/* ==================== 全局样式 ==================== */
/* 禁止文本选中，避免快速点击时出现蓝色选中蒙版 */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 允许输入框和文本内容区域选中文本 */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* ==================== CSS变量 ==================== */
:root {
  /* 颜色 */
  --color-bg: #1a0a0a;          /* 暗红黑色背景 */
  --color-bg-dark: #0d0505;     /* 深色背景 */
  --color-primary: #ffffff;      /* 白色（主色调） */
  --color-primary-light: #ffffff; /* 白色亮色 */
  --color-primary-dark: #cccccc;  /* 白色暗色（浅灰） */
  --color-text: #ffffff;        /* 白色文字 */
  --color-text-light: #cccccc;   /* 浅灰色文字 */
  --color-accent: #ffffff;       /* 强调色（白色） */
  --color-heart: #e74c3c;        /* 心形颜色（红色） */
  --color-heart-break: #555555;   /* 心形破碎颜色（灰色） */
  
  /* 毛玻璃效果 */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(201, 169, 110, 0.4);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(10px);
  
  /* 字体 */
  --font-title: 'KaiTi', 'STKaiti', 'FangSong', serif; /* 书法字体 */
  --font-text: 'SimSun', 'STSong', 'Noto Serif SC', serif; /* 古风衬线体 */
  --font-size-base: 16px;
  --font-size-title: 3rem;
  --font-size-subtitle: 1.5rem;
  --font-size-btn: 1.2rem;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ==================== 基础重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-text);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  cursor: none;
}

/* ==================== 自定义光标 ==================== */
#customCursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-12px, -8px);
  display: none;
}

#customCursor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==================== 点击粒子特效 ==================== */
.click-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  animation: particleFade 0.6s ease-out forwards;
}

@keyframes particleFade {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--px), var(--py)) scale(0);
  }
}

/* ==================== 屏幕通用样式 ==================== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.screen.active {
  display: flex;
}

/* ==================== 主菜单界面 ==================== */
#mainMenu {
  background-color: var(--color-bg); /* 温暖怀旧背景色 */
  background-image: url('assets/backgrounds/主菜单背景.png');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* 标题样式 - 居中显示 */
.menu-title {
  font-family: var(--font-title);
  font-size: var(--font-size-title);
  color: var(--color-primary); /* 白色 */
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.3),
    0 3px 5px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(255, 255, 255, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: var(--spacing-md);
  margin-top: 60px; /* 向下移动60px */
}

.menu-subtitle {
  font-family: var(--font-title);
  font-size: var(--font-size-subtitle);
  color: var(--color-text); /* 白色 */
  text-shadow: 
    0 0 3px rgba(255, 255, 255, 0.4);
  letter-spacing: 0.3em;
  text-align: center;
  margin-bottom: var(--spacing-xxl);
}

/* 按钮容器 */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  align-items: center;
  margin-top: 10vh;
}

/* 毛玻璃按钮样式 */
.menu-btn {
  /* 基础样式 */
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-xxl);
  min-width: 280px;
  
  /* 毛玻璃效果 */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  
  /* 文字样式 */
  font-family: var(--font-text);
  font-size: var(--font-size-btn);
  color: var(--color-text);
  letter-spacing: 0.2em;
  
  /* 形状 */
  border-radius: var(--radius-lg);
  cursor: pointer;
  
  /* 过渡动画 */
  transition: all var(--transition-normal);
}

/* 按钮悬停效果 */
.menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--color-primary);
  box-shadow: 
    var(--glass-shadow),
    inset 0 0 30px rgba(201, 169, 110, 0.2);
  transform: translateY(-2px);
}

/* 按钮图标 */
.menu-btn-icon {
  font-size: 1.5rem;
}

/* 按钮文字 */
.menu-btn-text {
  flex: 1;
  text-align: center;
}

/* ==================== 难度选择界面 ==================== */
#difficultySelect {
  background-image: url('assets/backgrounds/主菜单背景.png');
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg);
}

.screen-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--color-primary); /* 白色 */
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.3),
    0 3px 5px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(255, 255, 255, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.3em;
  margin-bottom: var(--spacing-xxl);
  margin-top: 60px; /* 向下移动60px */
}

.difficulty-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  align-items: center;
  margin-bottom: var(--spacing-xxl);
}

.diff-btn {
  /* 基础样式 */
  padding: var(--spacing-lg);
  min-width: 400px;
  
  /* 毛玻璃效果 */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* 文字样式 */
  font-family: var(--font-text);
  color: var(--color-text);
  text-align: left;
  
  /* 形状 */
  border-radius: var(--radius-lg);
  cursor: pointer;
  
  /* 过渡动画 */
  transition: all var(--transition-normal);
}

.diff-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.diff-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-primary); /* 血红色 */
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.1em;
}

.diff-desc {
  font-size: 0.9rem;
  color: var(--color-text); /* 白色 */
  line-height: 1.5;
}

.back-btn {
  /* 基础样式 */
  padding: var(--spacing-md) var(--spacing-xl);
  
  /* 毛玻璃效果 */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* 文字样式 */
  font-family: var(--font-text);
  font-size: 1rem;
  color: var(--color-text); /* 白色 */
  letter-spacing: 0.1em;
  
  /* 形状 */
  border-radius: var(--radius-md);
  cursor: pointer;
  
  /* 过渡动画 */
  transition: all var(--transition-normal);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
}

/* ==================== 游戏主界面 ==================== */
#gameScreen {
  /* 背景图由JS根据时段动态设置 */
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg);
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  transition: background-image 0.5s ease;
}

/* 顶部状态栏 */
#topBar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 100;
}

#heartContainer {
  display: flex;
  gap: var(--spacing-sm);
  font-size: 1.5rem;
  flex: 1;
}

.heart {
  transition: all var(--transition-normal);
}

.heart.broken {
  filter: grayscale(100%);
  opacity: 0.5;
}

#timeDisplay {
  font-family: var(--font-text);
  font-size: 1.1rem;
  color: #ffffff;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.1em;
  flex: 2;
  text-align: center;
}

#topRightButtons {
  display: flex;
  gap: var(--spacing-md);
  flex: 1;
  justify-content: flex-end;
}

.top-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-text);
  font-size: 0.9rem;
  color: var(--color-text);
  letter-spacing: 0.1em;
  
  /* 毛玻璃效果 */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(201, 169, 110, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  
  /* 形状 */
  border-radius: var(--radius-md);
  cursor: pointer;
  
  /* 过渡动画 */
  transition: all var(--transition-normal);
}

.top-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.top-btn:active {
  transform: translateY(0);
}

/* 主区域 */
#mainArea {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 80px var(--spacing-lg) var(--spacing-lg);
}

/* 立绘 */
.portrait {
  width: 300px;
  height: 500px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  opacity: 1;
}

.portrait.hidden {
  opacity: 0;
  visibility: hidden;
}

.portrait:not(.hidden) {
  visibility: visible;
}

/* 立绘切换动画 */
.portrait-switch {
  animation: portraitSwitch 0.3s ease-in-out;
}

@keyframes portraitSwitch {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.portrait img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
}

#npcPortrait {
  margin-right: auto;
}

#playerPortrait {
  margin-left: auto;
}

/* 文本框 */
#textBox {
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 200px; /* 固定高度 */
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  color: #ffffff;
  transition: all var(--transition-normal);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

#textBox.expanded {
  width: 80%;
  /* 展开时不改变高度，只改变宽度 */
}

/* 文本框头部（固定） */
#textBoxHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid rgba(201, 169, 110, 0.3);
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0; /* 不允许收缩 */
}

#speakerName {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--color-primary-light);
  letter-spacing: 0.1em;
  flex: 1;
}

/* 可滚动内容区域 */
#textContent {
  font-family: var(--font-text);
  font-size: var(--font-size-base);
  line-height: 1.8;
  color: #f0f0f0;
  overflow-y: scroll; /* 始终显示滚动条 */
  flex: 1; /* 占用剩余空间 */
  min-height: 0; /* 允许flex子元素收缩 */
  padding-right: var(--spacing-sm); /* 给滚动条留空间 */
}

/* 打字文本 */
#typingText {
}

/* 自定义滚动条样式（始终存在，但禁用时 subtle） */
#textContent::-webkit-scrollbar {
  width: 6px;
}

#textContent::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

#textContent::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.3); /* 默认半透明 */
  border-radius: 3px;
}

#textContent::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 110, 0.6); /* 悬停时高亮 */
}

#textContent::-webkit-scrollbar-thumb:active {
  background: rgba(201, 169, 110, 0.8);
}

/* 当内容未溢出时，滚动条仍显示但为禁用状态 */
#textContent::-webkit-scrollbar-thumb:disabled {
  background: rgba(201, 169, 110, 0.1);
}

/* 注意：已经去掉了 #cursor 相关的样式，因为去掉了光标功能 */

.textbox-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-light);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  flex-shrink: 0; /* 不允许收缩 */
}

.textbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-primary);
}

/* 右侧菜单（已废弃，按钮已移到顶部） */
#rightMenu {
  display: none;
}

/* 顶部按钮样式已在上面定义（.top-btn） */

/* 弹出菜单 */
.popup-menu {
  position: absolute;
  top: 70px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: var(--radius-lg);
  z-index: 150;
  min-width: 150px;
}

.popup-menu.hidden {
  display: none;
}

.action-btn,
.system-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-text);
  font-size: 1rem;
  color: #f0f0f0;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.1em;
}

.action-btn:hover,
.system-btn:hover {
  background: rgba(201, 169, 110, 0.2);
  border-color: var(--color-primary);
}

.action-btn:disabled,
.system-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: #888;
}

.action-btn:disabled:hover,
.system-btn:disabled:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(201, 169, 110, 0.2);
}

/* NPC选择面板 */
.selection-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: var(--spacing-xl);
}

.selection-panel.hidden {
  display: none;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.selection-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--color-primary);
  letter-spacing: 0.2em;
}

.selection-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: var(--spacing-xs);
  transition: color var(--transition-fast);
}

.selection-close-btn:hover {
  color: var(--color-primary);
}

.selection-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;  /* 防止横向滚动条 */
  padding-right: var(--spacing-sm);  /* 为滚动条留空间 */
}

.npc-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.npc-option:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-primary);
  transform: translateX(5px);
}

.npc-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;  /* 防止鼠标事件 */
}

.npc-option.disabled:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: none;
}

.npc-option-portrait {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.npc-option-info {
  flex: 1;
}

.npc-option-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
  letter-spacing: 0.1em;
}

.npc-option-title {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.npc-option-status {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.npc-option-status.in-inn {
  color: #2ecc71;
}

.npc-option-status.outside {
  color: #e74c3c;
}

/* ==================== 响应式设计 ==================== */
/* 移动端竖屏适配 */
@media (max-width: 768px) {
  :root {
    --font-size-title: 2rem;
    --font-size-subtitle: 1.2rem;
    --font-size-btn: 1rem;
  }
  
  .menu-btn {
    min-width: 200px;
    padding: var(--spacing-sm) var(--spacing-lg);
  }
  
  .diff-btn {
    min-width: 300px;
  }
  
  #textBox {
    width: 90%;
  }
  
  .portrait {
    width: 150px;
    height: 250px;
  }
}

/* 宽屏适配（16:9） */
@media (min-width: 1200px) {
  #textBox {
    width: 50%;
  }
  
  .portrait {
    width: 350px;
    height: 600px;
  }
}

/* ==================== 动画 ==================== */
/* 淡入淡出 */
.fade-in {
  animation: fadeIn var(--transition-normal);
}

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

.fade-out {
  animation: fadeOut var(--transition-normal);
}

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

/* 立绘切换 */
.portrait-switch {
  animation: portraitSwitch var(--transition-normal);
}

@keyframes portraitSwitch {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 110, 0.8);
}

/* ==================== 调试辅助 ==================== */
/* 显示当前屏幕的边框（调试用） */
/*.screen.active {*/
/*  border: 2px solid red;*/
/*}*/

/* 显示立绘区域的边框（调试用） */
/*.portrait {*/
/*  border: 1px solid blue;*/
/*}*/

/* ==================== 提示信息（毛玻璃特效）==================== */
.tip-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  color: #ffffff;
  font-size: 18px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tip-container.show {
  opacity: 1;
}

/* ==================== 物证获取提示（毛玻璃特效）==================== */
.evidence-toast {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(201, 169, 110, 0.6);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  color: #ffffff;
  font-size: 18px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  box-shadow: 0 0 20px rgba(201, 169, 110, 0.3);
}

.evidence-toast.hidden {
  display: none;
}

.evidence-toast.show {
  opacity: 1;
}

.evidence-toast-icon {
  font-size: 2rem;
}

/* ==================== 事件图片展示（毛玻璃特效）==================== */
.event-image-toast {
  position: fixed;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(192, 192, 192, 0.6); /* 银色border */
  border-radius: var(--radius-lg);
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(192, 192, 192, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  /* 宽度和位置通过JavaScript动态设置 */
}

.event-image-toast.hidden {
  display: none;
}

.event-image-toast.show {
  opacity: 1;
}

.event-image-toast img {
  width: 100%;
  height: auto;
  max-height: 350px;
  object-fit: contain;
  border-radius: 8px;
}

.event-image-toast-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.1em;
}

.evidence-toast-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.evidence-toast-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-accent);
}

.evidence-toast-name {
  font-size: 1rem;
  font-weight: bold;
}

.evidence-toast-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-xs);
}

/* ==================== 物证系统样式 ==================== */

/* 物证对话框容器 */
.evidence-dialog-container {
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* 物证对话框头部（固定） */
.evidence-dialog-container .dialog-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--color-bg-dark);
  z-index: 10;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(201, 169, 110, 0.3);
}

/* 物证对话框内容区（可滚动） */
.evidence-dialog-container .dialog-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* 物证列表 */
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

/* 物证项（左右结构） */
.evidence-item {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.evidence-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(201, 169, 110, 0.6);
}

/* 物证图片（左侧） */
.evidence-item-left {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.evidence-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.evidence-image.locked {
  filter: grayscale(100%) opacity(0.5);
}

/* 物证信息（右侧） */
.evidence-item-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.evidence-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(201, 169, 110, 0.3);
  padding-bottom: 8px;
}

.evidence-description {
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
  text-align: justify;
}

/* 未解锁物证样式 */
.evidence-item.locked {
  opacity: 0.7;
}

.evidence-item.locked .evidence-name {
  color: #888;
}

.evidence-item.locked .evidence-description {
  color: #666;
}

.evidence-tip-icon {
  font-size: 24px;
  animation: pulse 1.5s infinite;
}

.evidence-tip-text {
  font-size: 16px;
  color: #c9a96e;
}

.evidence-tip-text strong {
  color: #ffffff;
  font-size: 18px;
}

/* 物证类型标签 */
.evidence-type-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-right: 8px;
  font-family: var(--font-text);
}

.evidence-type-core {
  background: rgba(255, 100, 100, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(255, 100, 100, 0.5);
}

.evidence-type-edge {
  background: rgba(255, 200, 100, 0.3);
  color: #ffc864;
  border: 1px solid rgba(255, 200, 100, 0.5);
}

.evidence-type-distract {
  background: rgba(150, 150, 150, 0.3);
  color: #aaa;
  border: 1px solid rgba(150, 150, 150, 0.5);
}

/* 物证指向信息 */
.evidence-points-to {
  font-family: var(--font-text);
  font-size: 0.9rem;
  color: var(--color-primary);
  padding: 8px;
  background: rgba(201, 169, 110, 0.1);
  border-left: 3px solid var(--color-primary);
  margin-top: 8px;
  line-height: 1.5;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ==================== 结局画面 ==================== */
.ending-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  animation: fadeIn 0.8s ease;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

/* 优化：使用滚动条样式美化（如果需要滚动的话） */
.ending-screen::-webkit-scrollbar {
  width: 8px;
}

.ending-screen::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.ending-screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.ending-screen::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.ending-title {
  font-family: var(--font-title);
  font-size: 2.2rem;  /* 减小字体大小，节省空间 */
  color: var(--color-primary);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.3em;
  margin-bottom: 15px;  /* 减小底部间距 */
  text-align: center;
  animation: fadeIn 1s ease 0.3s both;
}

.ending-content {
  font-family: var(--font-text);
  font-size: 1.05rem;  /* 稍微减小字体大小 */
  color: var(--color-text);
  line-height: 1.8;  /* 减小行高，节省空间 */
  text-align: center;
  max-width: 600px;
  margin-bottom: 20px;  /* 减小底部间距 */
  animation: fadeIn 1s ease 0.6s both;
}

.ending-content p {
  margin-bottom: 10px;  /* 减小段落间距 */
}

.ending-btn {
  padding: 10px 40px;  /* 减小内边距 */
  font-family: var(--font-text);
  font-size: 1.1rem;  /* 稍微减小字体 */
  color: var(--color-text);
  letter-spacing: 0.2em;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  animation: fadeIn 1s ease 0.9s both;
  margin-top: 15px;  /* 减小顶部间距 */
  margin-bottom: 20px;  /* 减小底部间距 */
}

.ending-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.ending-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* 结局类型颜色区分 */
.ending-screen:has(.ending-title:contains("揭发")) {
  /* 成功结局 - 暖色 */
}

.ending-screen:has(.ending-title:contains("死亡")) {
  /* 死亡结局 - 暗红色调 */
  background: rgba(60, 0, 0, 0.92);
}

/* 结局CG容器 */
.ending-cg-container {
  width: 80%;
  max-width: 600px;
  margin: 0 auto 15px auto;  /* 减小底部间距 */
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease 0.5s both;
}

/* 结局CG图片 */
.ending-cg-image {
  max-width: 100%;
  max-height: 280px;  /* 减小最大高度，节省空间 */
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* ==================== 选择按钮 ==================== */
.choice-container {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  z-index: 200;
  animation: fadeIn 0.5s ease;
}

.choice-container.hidden {
  display: none;
}

.choice-btn {
  padding: var(--spacing-md) var(--spacing-xxl);
  font-family: var(--font-text);
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: 0.15em;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-width: 240px;
  text-align: center;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* ==================== 读档/存档对话框 ==================== */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
}

.dialog-overlay.hidden {
  display: none;
}

.dialog-container {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dialog-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--color-primary);
  letter-spacing: 0.2em;
}

.dialog-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: var(--spacing-xs);
  transition: color var(--transition-fast);
}

.dialog-close-btn:hover {
  color: var(--color-primary);
}

.dialog-content {
  margin-bottom: var(--spacing-lg);
}

.dialog-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.dialog-btn {
  padding: var(--spacing-md) var(--spacing-xl);
  font-family: var(--font-text);
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: 0.1em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.confirm-btn {
  background: rgba(201, 169, 110, 0.3);
  border: 1px solid rgba(201, 169, 110, 0.6);
}

.confirm-btn:hover {
  background: rgba(201, 169, 110, 0.5);
  border-color: var(--color-primary);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-primary);
}

/* ==================== 存档槽位 ==================== */
.save-slots-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.save-slot {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.save-slot:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-primary);
  transform: translateX(5px);
}

.save-slot.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.save-slot.disabled:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: none;
}

.save-slot-info {
  flex: 1;
}

.save-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.save-slot-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--color-primary);
  letter-spacing: 0.1em;
}

.save-slot-badge {
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: rgba(201, 169, 110, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.save-slot-details {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.save-slot-time {
  font-size: 0.8rem;
  color: var(--color-text-light);
  opacity: 0.7;
  margin-top: var(--spacing-xs);
}

.save-slot-delete {
  background: none;
  border: 1px solid rgba(231, 76, 60, 0.5);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.save-slot-delete:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
}

.save-slot-delete.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==================== 确认对话框 ==================== */
.confirm-dialog-container {
  max-width: 400px;
}

.confirm-message {
  font-family: var(--font-text);
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: 1.6;
  text-align: center;
  padding: var(--spacing-md) 0;
}
