:root {
  --bg: radial-gradient(circle at 20% 20%, #111629 0%, #0b0f1b 35%, #05070f 70%);
  --panel: rgba(17, 22, 41, 0.78);
  --card: rgba(255, 255, 255, 0.04);
  --text: #e8ecf4;
  --muted: #9aa4c2;
  --accent: #6ee7ff;
  --red: #ff6b6b;
  --white: #f4f7ff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(14, 18, 32, 0.9), rgba(15, 25, 41, 0.8));
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ee7ff, #bf7af0);
  box-shadow: 0 0 16px rgba(111, 231, 255, 0.7);
}

.brand .title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand .subtitle {
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 255, 0.5);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

button.primary {
  background: linear-gradient(135deg, #6ee7ff, #7c6bff);
  color: #0b0f1b;
  border-color: transparent;
  font-weight: 700;
}

button.ghost {
  background: rgba(255, 255, 255, 0.04);
}

.layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

#scene-panel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26, 32, 56, 0.7), rgba(10, 12, 22, 0.85));
  box-shadow: var(--shadow);
}

#board-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: radial-gradient(circle at 50% 30%, rgba(90, 112, 173, 0.08), rgba(10, 12, 22, 0.95));
}

#hud {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 12px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.1px;
}

.badge strong {
  font-weight: 800;
}

.badge.red {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc7c7;
}

.badge.white {
  background: rgba(255, 255, 255, 0.12);
  color: #f8f9ff;
}

.badge.dark {
  background: rgba(255, 255, 255, 0.06);
  color: #c4d1ff;
}

.badge.pulse {
  background: rgba(110, 231, 255, 0.15);
  color: #91f2ff;
  box-shadow: 0 0 12px rgba(110, 231, 255, 0.4);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(110, 231, 255, 0.35); }
  50% { transform: scale(1.04); box-shadow: 0 0 18px rgba(110, 231, 255, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(110, 231, 255, 0.35); }
}

.hidden {
  display: none;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.4;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
}

.list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.list li:last-child {
  border-bottom: none;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  #scene-panel {
    min-height: 480px;
  }
}

@media (max-width: 720px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .controls {
    width: 100%;
  }

  #scene-panel {
    min-height: 420px;
  }
}


/* 英文版语言切换 a 标签 */
.lang-switch {
  display: inline-block;
  padding: 6px 12px;
  margin-left: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: #4e8cff;                 /* 主色，可微调 */
  border: 1px solid #4e8cff55;    /* 半透明边框 */
  transition: all 0.25s ease;
}

.lang-switch:hover {
  background: #4e8cff22;          /* 微亮背景 */
  border-color: #4e8cff;          /* Hover 更明显 */
  transform: translateY(-1px);    /* 小幅跃起 */
}

.lang-switch:active {
  transform: translateY(0);
  opacity: .85;
}
