/* 像素风格基础样式 */
:root {
  --bg-dark: #1a1a2e;
  --bg-panel: #16213e;
  --bg-light: #0f3460;
  --accent-pink: #e94560;
  --accent-yellow: #f9ed69;
  --accent-cyan: #08d9d6;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0a0;
  --border-color: #533483;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Courier New', Courier, monospace;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

#game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
}

/* 状态栏 */
#status-bar {
  display: flex;
  justify-content: space-around;
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 15px;
  margin-bottom: 15px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-item .label {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 5px;
}

.status-item span:last-child {
  color: var(--accent-yellow);
  font-size: 16px;
}

/* 面板 */
.panel {
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 15px;
  margin-bottom: 15px;
}

.panel h2 {
  font-size: 16px;
  color: var(--accent-cyan);
  margin-bottom: 15px;
  text-shadow: 2px 2px 0 #000;
}

/* 成员列表 */
#member-list {
  min-height: 150px;
  margin-bottom: 15px;
}

.member-card {
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  padding: 10px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
}

.member-avatar {
  width: 60px;
  height: 60px;
  background: var(--bg-dark);
  border: 2px solid var(--accent-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.member-info h3 {
  font-size: 14px;
  color: var(--accent-yellow);
  margin-bottom: 5px;
}

.member-stats {
  font-size: 12px;
  color: var(--text-secondary);
}

.member-rarity {
  font-size: 12px;
  padding: 4px 8px;
  border: 2px solid;
}

.rarity-N { border-color: #888; color: #888; }
.rarity-R { border-color: #4CAF50; color: #4CAF50; }
.rarity-SR { border-color: #2196F3; color: #2196F3; }
.rarity-SSR { border-color: #FF9800; color: #FF9800; }

/* 按钮 */
.pixel-btn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 12px 20px;
  background: var(--accent-pink);
  color: white;
  border: 4px solid #b8354d;
  cursor: pointer;
  transition: transform 0.1s;
}

.pixel-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #000;
}

.pixel-btn:active:not(:disabled) {
  transform: translate(0, 0);
  box-shadow: none;
}

.pixel-btn:disabled {
  background: #555;
  border-color: #333;
  cursor: not-allowed;
}

#btn-recruit {
  width: 100%;
}

/* 行动按钮区域 */
#action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 日志 */
#game-log {
  max-height: 150px;
  overflow-y: auto;
  font-size: 12px;
}

.log-entry {
  padding: 5px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 5px;
}

.log-entry.info { color: var(--text-secondary); }
.log-entry.success { color: #4CAF50; }
.log-entry.warning { color: var(--accent-yellow); }
.log-entry.error { color: var(--accent-pink); }

/* 弹窗 */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#modal-overlay.hidden {
  display: none;
}

.pixel-modal {
  background: var(--bg-panel);
  border: 4px solid var(--accent-cyan);
  padding: 20px;
  max-width: 400px;
  width: 90%;
}

.pixel-modal h3 {
  color: var(--accent-yellow);
  margin-bottom: 15px;
  font-size: 16px;
}

.pixel-modal .modal-body {
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.8;
}

#modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ========== 场景系统 ========== */
.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

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

/* 场景头部 */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.screen-header h2 {
  font-size: 16px;
  color: var(--accent-cyan);
}

.back-btn {
  padding: 8px 15px;
  font-size: 12px;
}

/* ========== 主页场景 ========== */
.home-content {
  text-align: center;
  padding: 20px 0;
}

.game-title {
  font-size: 24px;
  color: var(--accent-yellow);
  margin-bottom: 5px;
  text-shadow: 3px 3px 0 #000;
}

.game-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.home-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-box {
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 15px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 16px;
  color: var(--accent-yellow);
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  max-width: 400px;
  margin: 0 auto 30px;
}

.pixel-btn.large {
  padding: 20px 30px;
  font-size: 16px;
}

.pixel-btn.small {
  padding: 8px 15px;
  font-size: 12px;
}

.home-bottom {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* ========== 成员列表场景 ========== */
.member-list {
  min-height: 200px;
}

.member-card {
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}

.member-card:hover {
  transform: translateX(5px);
  border-color: var(--accent-cyan);
}

.member-energy-bar {
  width: 100%;
  height: 4px;
  background: #333;
  margin-top: 5px;
}

.member-energy-fill {
  height: 100%;
  background: #4CAF50;
  transition: width 0.3s;
}

.member-energy-fill.low { background: #f44336; }
.member-energy-fill.medium { background: #ff9800; }

/* ========== 培训场景 ========== */
.train-content {
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 20px;
}

.train-member-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.train-member-info h3 {
  font-size: 16px;
  color: var(--accent-yellow);
}

.train-member-info .rarity {
  font-size: 12px;
}

.train-attrs {
  margin-bottom: 20px;
}

.train-attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.train-attr-name {
  font-size: 14px;
}

.train-attr-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.train-attr-value span {
  font-size: 16px;
  color: var(--accent-cyan);
  min-width: 30px;
  text-align: right;
}

.train-energy-bar {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  height: 20px;
  margin-bottom: 15px;
}

.train-energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #000;
}

/* ========== 演出场景 ========== */
.stage-content {
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 20px;
}

.stage-member-select {
  margin-bottom: 20px;
}

.stage-member-card {
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
}

.stage-member-card:hover {
  border-color: var(--accent-cyan);
}

.stage-member-card.selected {
  border-color: var(--accent-pink);
  background: var(--bg-dark);
}

.stage-field-select {
  margin-top: 20px;
}

.stage-field-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--border-color);
  margin-bottom: 10px;
  cursor: pointer;
}

.stage-field-option:hover {
  border-color: var(--accent-cyan);
}

.stage-field-option.selected {
  border-color: var(--accent-pink);
  background: var(--bg-dark);
}

.stage-field-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stage-start-btn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-size: 16px;
}

/* 空状态提示 */
.empty-tip {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 0;
}

/* ========== 团体管理场景 ========== */
.group-list {
  min-height: 200px;
}

.group-card {
  background: var(--bg-panel);
  border: 4px solid var(--border-color);
  padding: 15px;
  margin-bottom: 15px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.group-header h3 {
  font-size: 16px;
  color: var(--accent-yellow);
}

.group-grade {
  font-size: 14px;
  color: var(--accent-cyan);
}

.group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.group-member-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.group-member-chip:hover {
  border-color: var(--accent-pink);
}

.group-stats {
  font-size: 12px;
  color: var(--text-secondary);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
}
