:root {
  --bg: #f6f7f2;
  --ink: #253b32;
  --muted: #7c857d;
  --green: #345e49;
  --line: #e7eae2;
  --lime: #dce9b6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  transition:
    background 0.2s,
    transform 0.2s;
}
button:hover {
  filter: brightness(0.96);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
header {
  height: 88px;
  border-bottom: 1px solid var(--line);
  padding: 0 max(5%, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
}
.brand-icon {
  width: 34px;
  height: 38px;
  background: var(--green);
  color: #e5edbc;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 27px;
}
.brand-note {
  font-size: 12px;
  font-weight: 400;
  border-left: 1px solid #ccd2c6;
  padding-left: 14px;
  margin-left: 3px;
  letter-spacing: 1px;
}
.edition {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
}
main {
  max-width: 1120px;
  margin: auto;
  padding: 52px 26px 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.6px;
  color: #819176;
  font-weight: 600;
}
h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 15px 0;
}
h1 > span {
  color: #9aaf6b;
}
.intro > p {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.5px;
  line-height: 1.9;
}
.workspace {
  display: grid;
  grid-template-columns: 274px 1fr;
  gap: 24px;
  margin-top: 34px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.settings {
  padding: 27px 24px;
  align-self: start;
}
.section-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: #8e9a86;
  display: flex;
  gap: 12px;
  align-items: center;
}
.section-label > span {
  color: #52634f;
  font-size: 13px;
  letter-spacing: 1px;
}
.settings label {
  display: block;
  color: #6d796d;
  font-size: 12px;
  margin: 28px 0 10px;
}
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf8;
  color: #354c3c;
  outline: none;
}
select:focus,
input:focus {
  border-color: #6e926b;
  box-shadow: 0 0 0 3px #72966516;
}
.pool {
  margin: 27px 0 20px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.pool strong {
  font-size: 30px;
  font-weight: 500;
}
.pool span {
  color: #85917e;
  font-size: 11px;
}
.primary {
  border: 0;
  border-radius: 9px;
  padding: 14px 17px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.settings .primary {
  width: 100%;
}
.primary > span {
  font-size: 18px;
}
.help {
  font-size: 11px;
  color: #98a08f;
  line-height: 1.9;
  margin: 17px 0 0;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
  font-size: 11px;
  color: #85917e;
}
summary {
  line-height: 1.7;
}
#source-report {
  max-height: 220px;
  overflow: auto;
  line-height: 1.8;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
#source-report p {
  margin: 10px 0;
}
.quiz {
  padding: 27px 32px 0;
  min-width: 0;
  overflow: hidden;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.badge {
  font-size: 10px;
  padding: 6px 11px;
  border-radius: 20px;
  background: #f0f4e9;
  color: #7d8f60;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  color: #95a08e;
  font-size: 10px;
  margin-top: 23px;
  gap: 10px;
}
.progress-track {
  height: 4px;
  background: #f0f2eb;
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  width: 0;
  background: #a3ba76;
  transition: width 0.3s;
}
.welcome {
  text-align: center;
  padding: 38px 0 30px;
}
.letter-art {
  position: relative;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 100px;
  margin-bottom: 14px;
}
.letter-art > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 67px;
  background: #eef3e4;
  border: 1px solid #e1e8d3;
  border-radius: 12px;
  font-size: 39px;
  font-weight: 500;
  color: #5c7551;
  transform: rotate(-12deg);
}
.letter-art > span:nth-child(2) {
  background: #dce9b6;
  transform: translateY(-9px) rotate(7deg);
  color: #455e35;
}
.letter-art > span:nth-child(3) {
  transform: rotate(15deg);
  background: #f8f3e5;
  color: #a59265;
}
.letter-art i {
  position: absolute;
  right: -29px;
  top: -7px;
  color: #b6c68c;
  font-size: 26px;
  font-style: normal;
}
h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.welcome p {
  font-size: 12px;
  color: #8a9584;
  line-height: 2;
}
.example {
  display: flex;
  gap: 23px;
  justify-content: center;
  align-items: center;
  margin-top: 22px;
  font-size: 11px;
  color: #97a08e;
}
.example strong {
  font-size: 20px;
  color: #55754d;
  letter-spacing: 5px;
}
.example strong span {
  color: #c2ceb4;
}
.stats {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 23px 0 26px;
  gap: 16px;
}
.stats > div {
  border-right: 1px solid var(--line);
  padding-left: 20px;
}
.stats > div:first-child {
  padding-left: 0;
}
.stats > div:last-child {
  border: 0;
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #8e9887;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.green {
  background: #78a37c;
}
.red {
  background: #d79882;
}
.stats strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1;
}
.stats small {
  font-size: 16px;
  margin-left: 3px;
  color: #9ca58f;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ba490;
  margin: 25px 3px;
  letter-spacing: 0.4px;
}
.footer-star {
  color: #93aa65;
  margin-left: 8px;
}
.mobile {
  display: none;
}
#question {
  text-align: center;
  padding: 26px 0 20px;
  min-height: 352px;
}
.word-source {
  font-size: 10px;
  color: #8d9a80;
  letter-spacing: 1px;
}
.hint-label {
  font-size: 11px;
  color: #9ca58f;
  margin: 24px 0 10px;
}
#meaning {
  font-size: 27px;
  margin: 8px 0 24px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.answer-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 430px;
  margin: auto;
}
#initial {
  font-size: 32px;
  font-weight: 600;
  background: #edf3df;
  border-radius: 9px;
  min-width: 48px;
  padding: 6px;
  color: #5f7a44;
}
#answer {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce4d3;
  border-radius: 9px;
  background: #fafcf7;
  padding: 14px;
  font-size: 18px;
  outline: 0;
  color: #345e49;
  letter-spacing: 2px;
}
#answer::placeholder {
  font-size: 13px;
  letter-spacing: 1px;
  color: #b0b9a4;
}
.input-note,
.keyboard-note {
  font-size: 10px;
  color: #9ca58f;
}
.submit {
  margin: 18px auto 0;
  min-width: 190px;
}
#next {
  background: #dce9b6;
  color: #304b29;
  border: 1px solid #bdcf90;
}
#next:hover {
  background: #cfdfa0;
}
.keyboard-note {
  margin-top: 12px;
}
#feedback {
  font-size: 18px;
  margin-top: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#feedback.success {
  color: #245d3a;
  background: #edf7ee;
  border: 2px solid #8cbd94;
}
#feedback.error {
  color: #a23e2c;
  background: #fff1eb;
  border: 2px solid #dfa38f;
}
#feedback:not(:empty) {
  padding: 18px;
  border-radius: 12px;
  text-align: left;
}
.feedback-title {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feedback-word {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}
.feedback-answer {
  display: block;
  font-size: 16px;
  margin-top: 8px;
}
.records-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.records-toolbar button {
  padding: 9px 12px;
  font-size: 12px;
}
.stat-link {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.records-open {
  overflow: hidden;
}
.records-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #20382cc2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.records-dialog {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: 680px;
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.records-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.records-heading h2 {
  margin: 0;
  font-size: 23px;
}
.records-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.records-controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.records-controls label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.records-controls select {
  margin-top: 8px;
}
#records-summary {
  color: var(--muted);
  font-size: 13px;
}
.answer-record {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.answer-record strong {
  font-size: 21px;
  display: block;
  margin: 7px 0;
}
.answer-record p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.7;
}
.answer-record .answer-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  display: inline-block;
  background: #edf7ee;
  color: #245d3a;
}
.answer-record.wrong .answer-badge {
  background: #fff1eb;
  color: #a23e2c;
}
.answer-record.wrong .user-answer {
  color: #a23e2c;
}
.history-link {
  display: block;
  border: 0;
  background: transparent;
  padding: 8px 0;
  text-align: left;
  color: var(--green);
  font: inherit;
  line-height: 1.8;
  text-decoration: underline;
}
@media (max-width: 500px) {
  .records-dialog {
    padding: 18px;
  }
  .records-controls {
    flex-direction: column;
  }
  .records-overlay {
    padding: 10px;
  }
}
#results {
  text-align: center;
  padding: 26px 0;
}
.result-icon {
  font-size: 38px;
  color: #9db16d;
}
#result-summary {
  color: #87947c;
  line-height: 1.8;
  font-size: 13px;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.secondary {
  border: 1px solid #d9e1cd;
  border-radius: 9px;
  background: #f6f9ef;
  color: #63784e;
  padding: 13px 20px;
}
#mistakes {
  max-height: 235px;
  overflow: auto;
  text-align: left;
}
.mistake-row {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}
.mistake-row strong {
  color: #496d46;
  display: block;
  margin-bottom: 4px;
}
.mistake-row small {
  color: #a48471;
  overflow-wrap: anywhere;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #adc880;
  outline-offset: 3px;
}
@media (min-width: 1400px) {
  main {
    padding-top: 65px;
  }
  .workspace {
    margin-top: 42px;
  }
}
@media (max-width: 750px) {
  header {
    height: 70px;
    padding: 0 20px;
  }
  .brand {
    font-size: 19px;
  }
  .brand-note,
  .edition {
    display: none;
  }
  main {
    padding: 32px 18px 16px;
  }
  h1 {
    font-size: 29px;
    line-height: 1.5;
  }
  .intro > p {
    font-size: 12px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 25px;
  }
  .settings {
    padding: 21px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  .settings .section-label {
    grid-column: 1/-1;
    margin-bottom: 6px;
  }
  .settings label {
    margin: 8px 0 0;
  }
  .settings label[for="grade"] {
    grid-column: 1;
    grid-row: 2;
  }
  .settings label[for="unit"] {
    grid-column: 2;
    grid-row: 2;
  }
  .pool {
    margin: 7px 0;
    gap: 7px;
  }
  .pool strong {
    font-size: 26px;
  }
  .pool span {
    font-size: 10px;
  }
  .settings .primary {
    align-self: center;
    padding: 12px;
  }
  .help {
    grid-column: 1/-1;
    margin: 0;
    font-size: 10px;
  }
  .help br {
    display: none;
  }
  details {
    grid-column: 1/-1;
    margin: 4px 0 0;
    padding-top: 11px;
  }
  .quiz {
    padding: 22px 20px 0;
  }
  .welcome {
    padding-top: 28px;
  }
  .stats {
    padding: 22px 0;
  }
  .stats > div {
    padding-left: 12px;
  }
  footer {
    gap: 16px;
    line-height: 1.8;
    font-size: 9px;
  }
  footer > span:last-child {
    text-align: right;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .result-actions {
    flex-wrap: wrap;
  }
  #meaning {
    font-size: 24px;
  }
  .mobile {
    display: initial;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.workspace.testing {
  grid-template-columns: 1fr;
}
.term-metadata {
  display: inline-block;
  margin: 0 0 4px;
  padding: 6px 12px;
  border-radius: 16px;
  background: #eef3e4;
  color: #49673e;
  font-size: 13px;
  font-weight: 600;
}
.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 430px;
  margin: 12px auto 0;
  text-align: left;
}
#voice-input {
  flex-shrink: 0;
  padding: 10px 12px;
  font-size: 13px;
}
#voice-input[aria-pressed="true"] {
  background: #fff1eb;
  border-color: #dfa38f;
  color: #a23e2c;
}
#voice-status {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
@media (max-width: 500px) {
  .voice-controls {
    gap: 8px;
  }
  #voice-input {
    padding: 9px;
    font-size: 12px;
  }
}
#unfinished {
  margin: 12px 0 20px;
  padding: 12px;
  border: 1px solid #d9e1cd;
  border-radius: 9px;
  background: #f6f9ef;
}
#unfinished h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.unfinished-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.unfinished-item p {
  font-size: 11px;
  line-height: 1.7;
  margin: 0 0 8px;
  color: var(--muted);
}
.unfinished-item button {
  width: 100%;
  padding: 10px;
}
.progress-save-status {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}
#open-help {
  padding: 14px 16px;
  border: 1px solid #d9e1cd;
  border-radius: 9px;
  background: #fff8e8;
  line-height: 1.8;
}
body.testing header,
body.testing .intro {
  display: none;
}
body.testing main {
  padding-top: 20px;
}
body.testing .workspace {
  margin-top: 0;
}
.quiz-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
#back-to-settings {
  padding: 8px 10px;
  font-size: 11px;
}
.answer-wrap {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#initial {
  align-self: flex-start;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid #d5dfc7;
  border-radius: 8px;
  background: #f1f5e9;
  color: #536c42;
}
#initial span {
  font-size: 12px;
  font-weight: 400;
}
#initial strong {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
body.wechat-file .intro,
body.wechat-file #workspace,
body.wechat-file footer {
  display: none;
}
body.wechat-file #open-help {
  max-width: 560px;
  margin: 20px auto;
  font-size: 15px;
}
body.auth-required main {
  display: none;
}
.login-panel {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.login-panel h1 {
  font-size: 26px;
}
.login-panel p {
  color: var(--muted);
  line-height: 1.8;
}
.login-panel label {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
}
.login-panel input {
  width: 100%;
  padding: 12px;
  border: 1px solid #dce4d3;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}
.login-panel button {
  width: 100%;
  margin-top: 24px;
}
.login-panel #login-error {
  color: #b26c53;
  font-size: 13px;
}
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.account button {
  padding: 8px 12px;
}
#save-status {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
#retry-save {
  margin: 10px auto;
}
#history-list {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  max-height: 240px;
  overflow: auto;
}
@media (max-width: 750px) {
  .login-panel {
    margin: 32px 18px;
  }
  .account {
    gap: 5px;
    font-size: 11px;
  }
}
