/* ============ 北京版六年级英语 · 课堂游戏站 样式 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #cbd5e1;
  --gold: #f59e0b;
}
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 14px;
  font-size: 16px;
}
/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 60%, #3b82f6);
  color: #fff;
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 42px; }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.subtitle { font-size: 13px; opacity: .85; margin-top: 2px; }
.selectors { display: flex; gap: 10px; flex-wrap: wrap; }
.selectors select {
  font-size: 16px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  max-width: 300px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
/* ---------- 页签 ---------- */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.tab-btn {
  border: 2px solid var(--border);
  background: var(--card);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.3); }
/* ---------- 面板 ---------- */
.panel {
  display: none;
  background: var(--card);
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15,23,42,.06);
}
.panel.active { display: block; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h2 { font-size: 22px; color: var(--primary); }
.guide { color: var(--muted); margin: 4px 0 14px; font-size: 15px; }
.hint { color: var(--muted); font-size: 15px; }
.score-box { display: flex; gap: 12px; font-size: 17px; font-weight: 700; }
.score-box span { background: #f1f5f9; padding: 6px 12px; border-radius: 999px; color: var(--primary); }
.mini-block { margin-top: 22px; }
.mini-block h3 { font-size: 17px; margin-bottom: 10px; color: var(--text); }
/* ---------- 按钮 ---------- */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform .1s, box-shadow .15s;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }
.btn-red { background: var(--red); }
.btn-big { font-size: 22px; padding: 16px 28px; border-radius: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* ---------- 单词卡 ---------- */
.switch-line { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 6px 0 12px; cursor: pointer; }
.switch-line input { width: 20px; height: 20px; cursor: pointer; }
.flashcard {
  border: 3px dashed var(--border);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8fafc;
}
.fc-emoji { font-size: 72px; line-height: 1.1; }
.fc-en { font-size: 46px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.fc-ph { font-size: 24px; color: var(--muted); }
.fc-cn { font-size: 28px; color: var(--orange); font-weight: 700; }
/* 句型卡 */
.sen-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.sen-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
}
.sen-item .sen-en { font-size: 17px; font-weight: 600; }
.sen-item .sen-cn2 { font-size: 14px; color: var(--muted); margin-top: 3px; }
.sen-item .speak-btn { border: none; background: #eff6ff; color: var(--primary); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 18px; flex-shrink: 0; }
/* ---------- 看图选词 / 听音选词 ---------- */
.picture-stage { text-align: center; }
.pic-emoji { font-size: 130px; line-height: 1.2; margin: 6px 0 20px; }
.pic-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; max-width: 760px; margin: 0 auto; }
.pic-options button {
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 18px 10px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.pic-options button:hover { border-color: var(--primary); background: #eff6ff; }
.pic-options button.correct { border-color: var(--green); background: #dcfce7; color: var(--green); }
.pic-options button.wrong { border-color: var(--red); background: #fee2e2; color: var(--red); }
.pic-options button:disabled { cursor: default; }
.listen-stage { text-align: center; padding: 10px 0; }
.listen-stage .btn { margin-bottom: 18px; }
/* ---------- 听音拼写 / 句子拼装 ---------- */
.spell-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 26px;
  margin: 8px 0 18px;
  flex-wrap: wrap;
}
.spell-emoji { font-size: 56px; }
.spell-cn { font-weight: 700; color: var(--orange); }
.spell-answer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 62px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
  background: #f8fafc;
}
.tile {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  min-width: 40px;
  text-align: center;
  transition: all .12s;
}
.tile:hover { border-color: var(--primary); }
.tile.used { opacity: .35; pointer-events: none; }
.spell-letters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.sen-chips .tile { font-size: 19px; }
.sen-cn { text-align: center; font-size: 24px; font-weight: 700; color: var(--orange); margin: 6px 0 14px; }
.tile.space-tile { background: #e2e8f0; color: transparent; pointer-events: none; border: none; width: 34px; }
/* ---------- 职业工装连线 ---------- */
.match-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 80px;
  max-width: 820px;
  margin: 0 auto;
}
#matchSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.match-col { display: flex; flex-direction: column; gap: 12px; }
.match-item {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .15s;
  position: relative;
  z-index: 2;
}
.match-item .m-emoji { font-size: 36px; }
.match-item .m-cn { font-size: 13px; color: var(--muted); font-weight: 500; }
.match-item:hover { border-color: var(--primary); }
.match-item.selected { border-color: var(--gold); background: #fef3c7; }
.match-item.correct { border-color: var(--green); background: #dcfce7; pointer-events: none; opacity: .85; }
.match-item.wrong { border-color: var(--red); background: #fee2e2; }
/* ---------- 记忆翻牌 ---------- */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 14px;
  max-width: 640px;
  margin: 0 auto 6px;
}
.m-card { perspective: 600px; cursor: pointer; height: 130px; }
.m-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .35s;
  transform-style: preserve-3d;
}
.m-card.flipped .m-inner, .m-card.matched .m-inner { transform: rotateY(180deg); }
.m-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  text-align: center;
  padding: 8px;
}
.m-back { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 34px; }
.m-front { background: #fff; border: 2px solid var(--primary); transform: rotateY(180deg); color: var(--primary); }
.m-card.matched .m-front { border-color: var(--green); background: #dcfce7; color: var(--green); }
.m-card.flipped .m-back, .m-card.matched .m-back { background: linear-gradient(135deg, #16a34a, #15803d); }
/* ---------- Bingo ---------- */
.bingo-top { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bingo-current {
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  border: 3px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  min-height: 86px;
  background: #f8fafc;
}
.bingo-current .bc-emoji { font-size: 44px; margin-right: 10px; }
.bingo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; margin: 0 auto 16px; }
.bingo-cell {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 8px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: all .12s;
}
.bingo-cell .b-emoji { display: block; font-size: 34px; margin-bottom: 6px; }
.bingo-cell.marked { background: #dcfce7; border-color: var(--green); }
.bingo-history { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bingo-history .his-word { background: #eff6ff; color: var(--primary); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 15px; }
/* ---------- 幸运转盘 ---------- */
.wheel-wrap { position: relative; max-width: 420px; margin: 0 auto 10px; }
.wheel-arrow {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--red);
  font-size: 34px;
  text-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.wheel { width: 100%; padding-top: 100%; position: relative; }
#wheelSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 4s cubic-bezier(.17, .67, .12, .99);
  transform: rotate(0deg);
}
.wheel-result {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  min-height: 44px;
  margin: 6px 0;
}
/* ---------- 页脚 / 打印 ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0 8px; }
.footer code { background: #e2e8f0; border-radius: 4px; padding: 2px 6px; }

@media print {
  body * { visibility: hidden; }
  #bingoPrintArea, #bingoPrintArea * { visibility: visible; }
  #bingoPrintArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .bingo-grid { grid-template-columns: repeat(4, 1fr); max-width: none; }
}

@media (max-width: 640px) {
  body { padding: 8px; }
  .topbar h1 { font-size: 18px; }
  .fc-en { font-size: 32px; }
  .pic-emoji { font-size: 90px; }
  .memory-grid { grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 8px; }
  .m-card { height: 90px; }
  .m-front { font-size: 15px; }
  .match-wrap { gap: 0 16px; }
  .match-item { font-size: 15px; padding: 10px 8px; }
  .match-item .m-emoji { font-size: 26px; }
  .bingo-cell { font-size: 14px; padding: 10px 4px; }
  .bingo-cell .b-emoji { font-size: 24px; }
}
