.intro h1 {
  font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

.intro > p:not(.eyebrow) {
  font-family: "jf open 粉圓 2.0", "jf open 粉圓", "GenSenRounded TW", "華康圓體W7", "DFYuanW7", "Microsoft JhengHei", sans-serif;
}

.sound-card.tone-pink { background: #fde9ed; }
.sound-card.tone-orange { background: #ffeddc; }
.sound-card.tone-yellow { background: #fff5c9; }
.sound-card.tone-green { background: #e7f4df; }
.sound-card.tone-blue { background: #e3f1fa; }
.sound-card.tone-purple { background: #eee6f8; }

.more-xiaojin {
  display: inline-block;
  margin-top: 16px;
  padding: 11px 20px;
  border-radius: 999px;
  background: #77866a;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 12px rgba(73, 86, 62, 0.2);
  transition: transform 0.18s, background 0.18s;
}

.more-xiaojin:hover,
.more-xiaojin:focus-visible {
  background: #667459;
  transform: translateY(-2px);
}

.sound-card {
  position: relative;
  cursor: default;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.sound-card.playing {
  border-color: #617854;
  outline: 3px solid rgba(97, 120, 84, 0.45);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px rgba(119, 134, 106, 0.12), 0 8px 22px rgba(73, 86, 62, 0.18);
  animation: sound-pulse 1.25s ease-in-out infinite alternate;
}

.card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.listen,
.listen-answer {
  border: 1px solid #77866a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #4f6345;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.listen {
  margin-top: 13px;
}

.listen:hover,
.listen:focus-visible,
.listen.playing,
.listen-answer:hover,
.listen-answer:focus-visible,
.listen-answer.playing {
  background: #77866a;
  color: #fff;
}

.listen-answer {
  margin-top: 12px;
}

@keyframes sound-pulse {
  from { outline-color: rgba(97, 120, 84, 0.28); }
  to { outline-color: rgba(97, 120, 84, 0.72); }
}

@media (prefers-reduced-motion: reduce) {
  .sound-card.playing { animation: none; }
}

.game-nav {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  color: #746d63;
  font-weight: 700;
  text-decoration: none;
}

.game-nav:hover,
.game-nav:focus-visible,
.game-nav.active {
  background: #77866a;
  color: #fff;
}

.sound-card .card-main {
  text-align: center;
}

.sound-card .card-main b {
  margin: 0;
  font-size: clamp(3.6rem, 7vw, 5rem);
  line-height: 1.05;
}

.sound-card .listen {
  display: block;
  margin: 16px auto 0;
}

.classroom {
  grid-template-columns: 150px 1fr 200px;
}

.teacher-wrap {
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.teacher-wrap .teacher {
  width: 130px;
}

.teacher-speech {
  position: relative;
  width: 240px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 2px solid #342f28;
  border-radius: 18px;
  background: #fff;
  box-shadow: 4px 4px 0 #f3bd4b;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
}

.teacher-speech::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -10px;
  width: 16px;
  height: 16px;
  border-right: 2px solid #342f28;
  border-bottom: 2px solid #342f28;
  background: #fff;
  transform: rotate(45deg);
}

.speech-line {
  display: block;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .classroom {
    grid-template-columns: 72px 1fr 104px;
  }

  .teacher-wrap .teacher {
    width: 76px;
  }

  .teacher-speech {
    width: 174px;
    margin-left: -64px;
    padding: 8px 9px;
    border-radius: 13px;
    font-size: 0.68rem;
    line-height: 1.4;
    box-shadow: 3px 3px 0 #f3bd4b;
  }
}

@media (max-width: 600px) {
  .classroom {
    grid-template-columns: 72px 1fr 110px;
    grid-template-areas:
      "intro intro intro"
      "penguin . teacher";
    min-height: 0;
    row-gap: 14px;
    align-items: end;
  }

  .classroom > .penguin {
    grid-area: penguin;
    align-self: end;
    width: 72px;
  }

  .classroom .intro {
    grid-area: intro;
    padding: 0 4px;
  }

  .classroom .intro h1 {
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 1.8rem;
    line-height: 1.12;
  }

  .classroom .intro > p:not(.eyebrow) {
    max-width: 320px;
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .classroom .more-xiaojin {
    margin-top: 12px;
    padding: 9px 16px;
    font-size: 0.86rem;
  }

  .classroom .stats {
    gap: 6px;
    margin-top: 13px;
  }

  .classroom .stats span {
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .classroom .teacher-wrap {
    grid-area: teacher;
    width: 110px;
  }

  .classroom .teacher-wrap .teacher {
    width: 78px;
  }

  .classroom .teacher-speech {
    width: 174px;
    margin: 0 0 9px -70px;
    font-size: 0.68rem;
  }
}

.visit-footer { margin: 2rem auto 0; padding: 1.25rem 1rem; border-top: 1px solid #ddd; color: #555; text-align: center; font-size: 1rem; }
#visit-count { font-variant-numeric: tabular-nums; }

#detail-dialog { max-height: 85vh; max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain; }
#detail-dialog { width: min(1000px, calc(100% - 24px)); }
#detail-image-panel { margin-top: 0; min-width: 0; }
#detail-image-panel[hidden] { display: none; }
#detail-image { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 12px; }
#detail-image-status { font-size: 1rem; line-height: 1.5; }
#detail-image-status:empty { display: none; }
@media (max-width: 600px) { #detail-dialog { padding: 24px 16px; } }

.topbar .brand { color: var(--red-dark); }

.detail-layout { display: grid; grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
.detail-copy { min-width: 0; }
#detail-dialog .close { position: sticky; top: 0; float: right; z-index: 1; width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.detail-layout { clear: both; }
@media (max-width: 800px) {
 .detail-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
 #detail-dialog .big-symbol { font-size: 3rem; }
 #detail-dialog h2 { margin: 8px 0; }
 #detail-dialog dl { margin-top: 16px; }
 #detail-dialog dl div { padding: 10px 0; }
}
