:root {
  --bg: #e8f6e4;
  --card: #f7fbf4;
  --ink: #234833;
  --muted: #5d7a68;
  --line: #b7d9c2;
  --good: #2f7d55;
  --bad: #c45c4a;
  --btn: #3d8a62;
  --btn-text: #f7fff9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(800px 400px at 10% 0%, #d8f3c8, transparent 55%), var(--bg);
  color: var(--ink);
}

body {
  padding: 16px 14px 32px;
}

.wrap {
  width: min(720px, 100%);
  margin: 0 auto;
}

.hidden { display: none !important; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.bar a, .ghost, .primary, .danger, .play {
  font: inherit;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.bar a, .ghost {
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 16px;
}

h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.2;
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.wechat {
  background: #fff4d6;
  border: 2px solid #f0d48a;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 16px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 18px 12px;
  min-height: 120px;
  font-size: 18px;
  color: var(--ink);
}

.mode b {
  display: block;
  font-size: 22px;
  margin-top: 6px;
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 18px 16px 20px;
  text-align: center;
}

.pic {
  width: min(260px, 78%);
  max-height: 240px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  display: block;
  margin: 0 auto 12px;
}

.word {
  font-size: 40px;
  margin: 0;
  letter-spacing: 0.5px;
}

.zh {
  margin: 6px 0 14px;
  font-size: 22px;
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.primary, .danger, .play {
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 20px;
}

.primary { background: var(--btn); color: var(--btn-text); }
.danger { background: #c45c4a; color: #fff; }
.play {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  font-size: 34px;
  background: #dceee3;
}

input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 28px;
  text-align: center;
  padding: 12px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  margin: 8px 0 12px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.choice {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  color: inherit;
  font: inherit;
}

.choice.word-choice {
  font-size: 28px;
  font-weight: 800;
}

.choice img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.choice span {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
}

.choice.ok { border-color: var(--good); background: #e7f6ee; }
.choice.no { border-color: var(--bad); background: #fdeceb; }

.match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.col { display: flex; flex-direction: column; gap: 10px; }

.node {
  min-height: 64px;
  border-radius: 16px;
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  padding: 8px;
}

.node img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.node.on { border-color: #3d7a62; background: #e7f3ec; }
.node.done { opacity: 0.38; }

.msg {
  min-height: 28px;
  font-size: 20px;
  font-weight: 800;
  margin: 10px 0 0;
}
.msg.ok { color: var(--good); }
.msg.no { color: var(--bad); }

.progress {
  font-size: 18px;
  color: var(--muted);
  font-weight: 800;
}

#soundFind {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  margin: 0 0 14px;
  background: #fff;
}
.sounds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  align-items: stretch;
}
.sound-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 12px 10px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 148px;
  min-width: 0;
  position: relative;
}
.sound-mark {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  min-height: 34px;
}
.sound-ipa {
  display: block;
  min-height: 22px;
  font-size: 16px;
  font-weight: 800;
  color: #2a8f7a;
}
.sound-tile .sound-ipa {
  color: #2a8f7a;
  font-size: 16px;
}
.sound-label .sound-ipa {
  display: inline;
  min-height: 0;
  margin-left: 8px;
  font-size: 20px;
  color: #2a8f7a;
}
.sound-ex {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 4px;
}
.sound-n {
  display: block;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #2f6adf;
}
.sound-tile .resume-tag {
  position: static;
  margin-top: 4px;
}
@media (min-width: 640px) {
  .sounds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sound-tile b {
  display: block;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}
.sound-tile span, .sound-tile em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}
.sound-tile em { margin-top: 6px; color: #2f6adf; }
.sound-label {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #2f6adf;
}
.phon-word mark {
  background: transparent;
  color: #ef7a32;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
#name-anchor { height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
