/* style.css */
/* ===== 全局变量与重置 ===== */
:root {
  --terminal-green: #00ff41;
  --terminal-blue: #00bfff;
  --terminal-red: #ff0040;
  --terminal-yellow: #ffff00;
  --terminal-purple: #ff00ff;
  --terminal-dark: #0a0a0a;
  --terminal-gray: #1a1a1a;
  --terminal-light: #e0e0e0;
  
  --neon-glow: 0 0 10px;
  --terminal-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 基础身体样式 ===== */
body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: var(--terminal-dark);
  color: var(--terminal-light);
  overflow: hidden;
  font-family: 'Courier New', monospace;
  position: relative;
}

/* ===== 全局扫描线效果 ===== */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      rgba(0, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 4px
    );
  pointer-events: none;
  z-index: 999;
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(10px); }
}

/* ===== 战术终端背景 ===== */
.terminal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 255, 100, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 150, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

/* ===== 菜单背景装饰 ===== */
.menu-bg-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 50%, rgba(0, 200, 255, 0.03) 0%, transparent 70%),
    repeating-linear-gradient(45deg, rgba(0,255,255,0.02) 0px, rgba(0,255,255,0.02) 1px, transparent 1px, transparent 11px),
    repeating-linear-gradient(-45deg, rgba(0,255,255,0.02) 0px, rgba(0,255,255,0.02) 1px, transparent 1px, transparent 11px);
  pointer-events: none;
  z-index: 1;
}

/* ===== 画布样式 ===== */
canvas {
  border: 2px solid var(--terminal-blue);
  background: var(--terminal-dark);
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
  display: none;
  box-shadow: var(--neon-glow) var(--terminal-blue);
  z-index: 10;
}

/* ===== 主菜单图片容器 ===== */
.main-menu-left-image-container,
.main-menu-right-image-container {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.3));
  transition: transform 0.3s ease;
}

.main-menu-left-image-container:hover,
.main-menu-right-image-container:hover {
  transform: translateY(-50%) scale(1.02);
}

.main-menu-left-image-container { left: 20px; }
.main-menu-right-image-container { right: 20px; }

.main-menu-left-image,
.main-menu-right-image {
  cursor: pointer;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

/* ===== 战术HUD样式 ===== */
.tactical-hud {
  position: absolute;
  background: rgba(10, 15, 20, 0.85);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: var(--neon-glow) rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  z-index: 50;
}

.stats {
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.hud-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.hud-item:last-child {
  border-bottom: none;
}

.hud-label {
  font-size: 12px;
  color: var(--terminal-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--terminal-green);
  font-family: 'Courier New', monospace;
}

/* ===== 音量控制按钮 ===== */
.volume-btn {
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 20, 0.85);
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  cursor: pointer;
  color: var(--terminal-blue);
  font-weight: bold;
  transition: all 0.2s ease;
  z-index: 50;
}

.volume-btn:hover {
  background: rgba(0, 30, 40, 0.9);
  border-color: var(--terminal-green);
  transform: scale(1.05);
  box-shadow: var(--neon-glow) var(--terminal-green);
}

.volume-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 3px var(--terminal-blue));
}

/* ===== 冲刺状态指示器 ===== */
.sprint-hud {
  bottom: 20px;
  left: 20px;
  width: 240px;
}

.sprint-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sprint-key {
  font-size: 12px;
  color: var(--terminal-yellow);
  background: rgba(255, 255, 0, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

.tactical-bar {
  position: relative;
  height: 20px;
  background: rgba(0, 30, 60, 0.5);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
}

.sprint-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--terminal-green) 0%, var(--terminal-blue) 100%);
  width: 100%;
  transition: width 0.1s linear;
  box-shadow: var(--neon-glow) var(--terminal-green);
}

.sprint-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--terminal-dark);
  font-weight: bold;
}

/* ===== 战术终端面板 ===== */
.terminal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 15, 20, 0.95);
  padding: 0;
  border-radius: 15px;
  display: none;
  max-width: 90%;
  box-shadow: 
    0 0 50px rgba(0, 255, 255, 0.4),
    var(--terminal-shadow);
  border: 1px solid rgba(0, 255, 255, 0.4);
  z-index: 100;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

/* 终端头部 */
.terminal-header {
  background: linear-gradient(90deg, rgba(0, 40, 60, 0.9) 0%, rgba(0, 20, 40, 0.9) 100%);
  padding: 20px 30px;
  border-bottom: 2px solid var(--terminal-blue);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: bold;
  color: var(--terminal-green);
  margin-bottom: 10px;
}

.terminal-prompt {
  color: var(--terminal-blue);
  font-size: 20px;
}

.terminal-cursor {
  width: 3px;
  height: 24px;
  background: var(--terminal-green);
  animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.terminal-status {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--terminal-light);
}

.status-item {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.status-item.success {
  border-color: var(--terminal-green);
  color: var(--terminal-green);
}

.status-item.warning {
  border-color: var(--terminal-yellow);
  color: var(--terminal-yellow);
}

.status-item.critical {
  border-color: var(--terminal-red);
  color: var(--terminal-red);
}

.status-item.paused {
  border-color: var(--terminal-purple);
  color: var(--terminal-purple);
}

/* 终端内容区 */
.terminal-content {
  padding: 30px;
}

/* ===== 命令列表 ===== */
.command-list {
  margin-bottom: 30px;
}

.command-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 14px;
  color: var(--terminal-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  padding-bottom: 5px;
}

.command-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.command-key {
  font-family: 'Courier New', monospace;
  color: var(--terminal-yellow);
  background: rgba(255, 255, 0, 0.1);
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 15px;
  min-width: 100px;
  text-align: center;
  font-weight: bold;
}

.command-desc {
  color: var(--terminal-light);
}

/* ===== 终端菜单按钮 ===== */
.terminal-menu {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 30px 0;
}

.btn-terminal {
  margin: 0;
  padding: 15px 30px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.btn-terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-terminal:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(90deg, var(--terminal-green) 0%, #00cc66 100%);
  color: var(--terminal-dark);
  box-shadow: var(--neon-glow) var(--terminal-green);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 255, 65, 0.6);
}

.btn-secondary {
  background: linear-gradient(90deg, var(--terminal-blue) 0%, #0088cc 100%);
  color: #fff;
  box-shadow: var(--neon-glow) var(--terminal-blue);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 180, 255, 0.6);
}

.btn-back-terminal {
  background: linear-gradient(90deg, #666 0%, #444 100%);
  color: #fff;
  margin-top: 20px;
  padding: 10px 25px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back-terminal:hover {
  transform: translateY(-2px);
  background: linear-gradient(90deg, #777 0%, #555 100%);
}

/* ===== 终端底部 ===== */
.terminal-footer {
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(0, 255, 255, 0.2);
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.system-info {
  display: flex;
  gap: 20px;
}

/* ===== 关卡选择网格 ===== */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
  max-width: 600px;
}

.level-grid button {
  padding: 25px 15px;
  font-size: 14px;
  background: white;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
color:red;
}

.level-grid button:hover {
  border-color: var(--terminal-green);
  background: rgba(0, 40, 30, 0.8);
  transform: translateY(-5px);
  box-shadow: var(--neon-glow) var(--terminal-green);
}

.level-grid button.boss-level {
  border-color: var(--terminal-red);
}

.level-grid button.boss-level:hover {
  border-color: var(--terminal-red);
  box-shadow: var(--neon-glow) var(--terminal-red);
}

/* ===== 商店卡片 ===== */
.shop-terminal {
  min-width: 700px;
  max-width: 800px;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shop-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: rgba(20, 30, 40, 0.7);
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.shop-card:hover {
  background: rgba(30, 40, 50, 0.9);
  border-color: var(--terminal-blue);
  transform: translateX(10px);
}

.card-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  border: 2px solid var(--terminal-blue);
  box-shadow: var(--neon-glow) var(--terminal-blue);
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--terminal-green);
  margin-bottom: 5px;
  text-transform: uppercase;
}

.card-tag {
  display: inline-block;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-tag.consumable {
  background: rgba(0, 255, 65, 0.2);
  color: var(--terminal-green);
  border: 1px solid var(--terminal-green);
}

.card-tag.upgrade {
  background: rgba(0, 180, 255, 0.2);
  color: var(--terminal-blue);
  border: 1px solid var(--terminal-blue);
}

.card-tag.companion {
  background: rgba(255, 0, 255, 0.2);
  color: var(--terminal-purple);
  border: 1px solid var(--terminal-purple);
}

.card-desc {
  font-size: 12px;
  color: var(--terminal-light);
  line-height: 1.5;
}

.card-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 120px;
}

.card-price {
  font-size: 16px;
  font-weight: bold;
  color: var(--terminal-yellow);
  font-family: 'Courier New', monospace;
  text-shadow: var(--neon-glow) var(--terminal-yellow);
}

.btn-buy-terminal {
  padding: 8px 20px;
  font-size: 14px;
  background: linear-gradient(90deg, var(--terminal-yellow) 0%, #ffaa00 100%);
  color: var(--terminal-dark);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
  text-transform: uppercase;
}

.btn-buy-terminal:hover {
  transform: translateY(-2px);
  box-shadow: var(--neon-glow) var(--terminal-yellow);
}

.btn-buy-terminal:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== 任务统计 ===== */
.mission-stats {
  margin: 20px 0;
  padding: 20px;
  background: rgba(0, 30, 50, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.mission-stats p {
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mission-stats strong,
.mission-stats span {
  color: var(--terminal-yellow);
  font-size: 24px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  text-shadow: var(--neon-glow) var(--terminal-yellow);
}

/* ===== 暂停提示 ===== */
.pause-hint {
  text-align: center;
  font-size: 16px;
  color: var(--terminal-blue);
  padding: 20px;
  border: 1px dashed rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 20, 40, 0.3);
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 20, 30, 0.5);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--terminal-green) 0%, var(--terminal-blue) 100%);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00ff66 0%, #00aaff 100%);
}

/* ===== 按钮组 ===== */
.button-group {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .terminal-panel {
    min-width: 90% !important;
    padding: 0;
  }
  
  .terminal-header,
  .terminal-content,
  .terminal-footer {
    padding: 20px;
  }
  
  .level-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .shop-card {
    flex-direction: column;
    text-align: center;
  }
  
  .card-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .card-action {
    margin-top: 15px;
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
}