/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #fff;
}

#app {
  text-align: center;
}

h1 { font-size: 28px; margin-bottom: 12px; letter-spacing: 2px; }

/* ===== 状态栏 ===== */
#status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

#turn-indicator {
  font-size: 18px;
  font-weight: bold;
  padding: 6px 16px;
  background: #16213e;
  border-radius: 8px;
}

#reset-btn, #victory-reset-btn {
  padding: 8px 20px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

#reset-btn:hover, #victory-reset-btn:hover { background: #c73650; }

/* ===== 棋盘容器 ===== */
#board-container {
  display: inline-block;
  border: 4px solid #533a1b;
  border-radius: 6px;
  background: #b58863;
  padding: 4px;
}

#board {
  display: grid;
  grid-template-columns: repeat(8, 64px);
  grid-template-rows: repeat(8, 64px);
}

/* ===== 格子 ===== */
.cell {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background 0.15s;
}

.cell.light { background: #f0d9b5; }
.cell.dark  { background: #b58863; }

.cell.selected {
  background: #7fc97f !important;  /* 选中的格子高亮 */
  box-shadow: inset 0 0 0 2px #2d8a2d;
}

.cell.legal-move {
  cursor: pointer;
}

.cell.legal-move::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.cell.legal-capture {
  cursor: pointer;
}

.cell.legal-capture::after {
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(233, 69, 96, 0.6);
  background: rgba(233, 69, 96, 0.15);
  pointer-events: none;
  box-sizing: border-box;
}

/* ===== 棋子 ===== */
.piece {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  cursor: pointer;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.piece.white { color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.piece.black { color: #222; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }

/* ===== 吃子区 ===== */
#captured-area {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  min-height: 36px;
  font-size: 24px;
}

/* ===== 胜利弹窗 ===== */
#victory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

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

#victory-box {
  background: #16213e;
  padding: 40px 50px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#victory-box h2 { font-size: 36px; margin-bottom: 12px; }
#victory-box p  { font-size: 20px; margin-bottom: 20px; }
#victory-box button { font-size: 18px; padding: 10px 30px; }
