:root {
  --ink: #183243;
  --muted: #5f6f7a;
  --paper: #fffdf8;
  --line: #d7e1e6;
  --teal: #0e8f8f;
  --teal-dark: #066c70;
  --yellow: #ffd35c;
  --coral: #f56f60;
  --blue: #5b7ee5;
  --green: #48a868;
  --shadow: 0 18px 45px rgba(27, 59, 75, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Arial", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(14, 143, 143, 0.1), rgba(255, 211, 92, 0.16)),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

a {
  color: inherit;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 143, 143, 0.45);
  box-shadow: 0 8px 20px rgba(24, 50, 67, 0.12);
}

button:active {
  transform: translateY(0);
}

.app {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 48px;
}

.study-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(14, 143, 143, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.icon-button {
  width: 54px;
  min-width: 54px;
  height: 54px;
  padding: 0;
  font-size: 2.2rem;
  line-height: 1;
}

.word-card {
  min-height: clamp(460px, 58vh, 680px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 44px 22px;
  border: 2px solid rgba(91, 126, 229, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(255, 211, 92, 0.24), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 111, 96, 0.16), transparent 28%),
    #ffffff;
}

.badge {
  min-width: 76px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 1.08rem;
  font-weight: 800;
  text-align: center;
}

.word {
  margin: 0;
  max-width: 100%;
  color: var(--teal-dark);
  font-size: clamp(4.6rem, 17vw, 11.5rem);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.phonetic {
  min-height: 42px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.55rem, 3.4vw, 2.5rem);
  font-weight: 800;
}

.meaning {
  min-height: 76px;
  margin: 0;
  color: var(--coral);
  font-size: clamp(3rem, 7.2vw, 5.2rem);
  font-weight: 900;
}

.meaning.hidden {
  color: transparent;
  text-shadow: 0 0 12px rgba(245, 111, 96, 0.32);
  user-select: none;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.speech-status {
  min-height: 24px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
}

.primary {
  border-color: var(--teal);
  color: #ffffff;
  background: var(--teal);
}

.practice-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.voice-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 800;
}

.voice-row select {
  width: min(280px, 50vw);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 32px 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.exam-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 800;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.word-list {
  padding: 34px 0 0;
}

.word-list h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.word-chip {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  background: #ffffff;
}

.word-chip strong {
  color: var(--teal-dark);
  font-size: 1.1rem;
}

.word-chip span {
  color: var(--muted);
  font-size: 0.92rem;
}

.word-chip.active {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 2px rgba(245, 111, 96, 0.18);
}

.exam-app {
  max-width: 980px;
}

.exam-shell {
  gap: 16px;
}

.exam-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.exam-link.subtle {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
}

.exam-card {
  min-height: clamp(380px, 54vh, 620px);
}

.exam-meaning {
  margin: 0;
  color: var(--coral);
  font-size: clamp(3.2rem, 10vw, 7rem);
  font-weight: 900;
  text-align: center;
}

.exam-hint {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 800;
  text-align: center;
}

.exam-answer {
  min-height: 52px;
  margin: 0;
  color: var(--teal-dark);
  font-size: clamp(1.7rem, 5vw, 3.2rem);
  font-weight: 900;
  text-align: center;
}

.exam-result[data-tone="right"] {
  color: var(--green);
}

.exam-result[data-tone="wrong"] {
  color: var(--coral);
}

.exam-result[data-tone="warn"] {
  color: var(--blue);
}

.recognized-text {
  min-height: 28px;
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 20px, 680px);
    padding-top: 14px;
  }

  .study-shell {
    padding: 14px;
  }

  .word-card {
    min-height: 390px;
    padding: 28px 14px;
  }

  .icon-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .practice-panel {
    align-items: stretch;
  }

  .voice-row {
    width: 100%;
    justify-content: space-between;
  }

  .voice-row select {
    width: min(100%, 230px);
  }

  .practice-panel button {
    width: 100%;
  }

  .exam-link {
    width: 100%;
  }

  .exam-top {
    flex-direction: column;
  }

  .exam-top button {
    width: 100%;
  }
}
