:root {
  color-scheme: light;
  --ink: #20352f;
  --green: #24533f;
  --forest: #204736;
  --sub: #52645b;
  --line: #d7ded4;
  --paper: #f7f8f3;
  --card: #fff;
  --pale: #eef2e8;
  --honey: #f3c37a;
  --warn: #844028;
  --serif: "STIX Two Text",Georgia,"Songti SC","Noto Serif CJK SC",serif;
  --sans: "DM Sans",-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 280px;
}

button,input {
  font: inherit;
}

button,a,input {
  touch-action: manipulation;
}

a {
  color: var(--green);
  text-underline-offset: 4px;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

a,button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible {
  outline: 3px solid #bd7d23;
  outline-offset: 3px;
}

#main:focus {
  outline: none;
}

.skip {
  position: fixed;
  top: -6rem;
  left: .75rem;
  z-index: 5;
  background: white;
  padding: .5rem 1rem;
}

.skip:focus {
  top: .75rem;
}

.mast {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.mast-inner,.wrap,.sitefoot {
  width: min(calc(100% - 5rem),1140px);
  margin: auto;
}

.mast-inner {
  display: flex;
  min-height: 74px;
  align-items: stretch;
  gap: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--forest);
  text-decoration: none;
  font: 700 1.6rem var(--serif);
  letter-spacing: .055em;
}

.brand img {
  border-radius: 11px;
  display: block;
}

.mast nav {
  display: flex;
  gap: 1.8rem;
}

.mast nav a {
  display: flex;
  align-items: center;
  position: relative;
  color: var(--sub);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  padding: .25rem .1rem;
}

.mast nav a[aria-current="page"] {
  color: var(--green);
}

.mast nav a[aria-current="page"]:after {
  position: absolute;
  content: "";
  height: 3px;
  background: var(--green);
  bottom: 0;
  left: 0;
  right: 0;
}

.pair {
  background: transparent;
  border: 0;
  padding: .4rem 0;
  margin-left: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  color: var(--sub);
}

.course-switch {
  border: 0;
}

.course-switch.hero-k {
  background: transparent;
  padding: .3rem 0;
}

.course-switch:hover,.pair:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pair span {
  font: 700 .76rem/1.7 Georgia,serif;
  letter-spacing: .04em;
  padding: 0 .4rem;
  background: #e8efe3;
  border: 1px solid #cbd9c4;
  border-radius: .35rem;
  color: var(--green);
}

.wrap {
  padding: 2.2rem 0 1.4rem;
  min-height: calc(100svh - 165px);
}

.heading,.section-head,.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.heading {
  margin-bottom: 1.15rem;
}

.heading h1 {
  font-size: clamp(1.5rem,2.2vw,1.85rem);
  letter-spacing: .025em;
  margin: 0;
}

.date {
  font-size: .9rem;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.ico {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -.23em;
  flex: none;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--forest);
  border-radius: 18px;
  color: #fff;
  min-height: 274px;
  display: flex;
  align-items: center;
}

.hero-copy {
  padding: 2.1rem 3rem;
  width: 65%;
  position: relative;
  z-index: 1;
}

.hero-k {
  color: #e1ebd9;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .07em;
}

.hero-k:before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--honey);
}

.hero h2 {
  font: 700 clamp(2.5rem,4.5vw,3.75rem)/1.28 var(--serif);
  letter-spacing: .045em;
  margin: .45rem 0 .45rem;
}

.hero p {
  margin: 0 0 1.45rem;
  color: #e4ece0;
  max-width: 34rem;
}

.hero-art {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 44%;
  height: 108%;
  object-fit: contain;
  pointer-events: none;
}

.primary,.secondary,.goldbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border-radius: 9px;
  min-height: 46px;
  padding: .6rem 1.2rem;
  font-weight: 650;
  border: 1px solid transparent;
  text-decoration: none;
}

.primary {
  background: var(--green);
  color: white;
}

.primary:hover {
  background: #183e2d;
}

.goldbtn {
  background: var(--honey);
  color: #352d1c;
}

.goldbtn:hover {
  background: #ffcf8a;
}

.secondary {
  color: var(--green);
  background: white;
  border-color: #bac8b9;
}

.secondary:hover,.toggle:hover {
  background: var(--pale);
}

.textbtn {
  font: inherit;
  font-size: .9rem;
  border: none;
  background: none;
  color: var(--green);
  padding: .4rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0,1.48fr) minmax(0,1fr);
  gap: 1.35rem;
  margin: 1.4rem 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 1.5rem 1.7rem;
}

.section-head {
  margin: 0 0 1.1rem;
}

.section-head h2,.panel>h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.section-head h2 .ico {
  color: var(--green);
}

.section-head a {
  font-size: .85rem;
  font-weight: 550;
}

.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field+.field {
  margin-top: 1.2rem;
}

.field legend {
  font-size: .89rem;
  font-weight: 650;
  margin-bottom: .5rem;
  padding: 0;
  color: var(--sub);
}

.seg-row {
  display: flex;
  gap: .42rem;
  flex-wrap: wrap;
}

.toggle {
  border: 1px solid #cbd5c8;
  background: #fff;
  color: #364f3e;
  border-radius: 8px;
  min-height: 42px;
  font-size: .91rem;
  padding: .4rem .85rem;
  line-height: 1.35;
}

.toggle[aria-pressed="true"] {
  background: #e3edda;
  border-color: #628060;
  color: #203f2b;
  font-weight: 650;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.mode-row button {
  text-align: left;
  display: flex;
  gap: .55rem;
  align-items: center;
  min-height: 44px;
  padding: .55rem .8rem;
}

.choice-dot {
  margin-left: auto;
  border: 1px solid #9baa99;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
}

.toggle[aria-pressed=true] .choice-dot {
  border: 4px solid var(--green);
}

.subtle,.helper {
  color: var(--sub);
  font-size: .9rem;
  line-height: 1.6;
}

.helper {
  margin: .55rem 0 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin: 1.7rem 0 1.55rem;
}

.stat-grid>div {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.stat-grid>div:first-child {
  padding: 0;
  border: 0;
}

.stat-grid strong {
  font: 600 2.25rem/1.1 var(--serif);
  color: var(--forest);
  display: block;
}

.stat-grid span {
  color: var(--sub);
  font-size: .86rem;
}

.bar {
  background: #e8ece4;
  height: 8px;
  border-radius: 1rem;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #688a5c;
}

.meter-note {
  margin: .65rem 0 0;
  color: var(--sub);
  font-size: .86rem;
}

.local-note {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: var(--sub);
  font-size: .875rem;
  line-height: 1.65;
}

.local-note .ico {
  margin-top: .18rem;
}

.sitefoot {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0 1.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--sub);
  font-size: .85rem;
}

.sitefoot span {
  font: 700 1rem var(--serif);
}

.sitefoot a {
  color: var(--sub);
}

#notice:not(:empty) {
  position: fixed;
  max-width: min(90vw,38rem);
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #263b31;
  color: white;
  padding: .6rem 1rem;
  border-radius: 8px;
  z-index: 3;
  font-size: .9rem;
}

.reading {
  max-width: 760px;
  margin: 0 auto;
}

.reading+.reading {
  margin-top: 1rem;
}

.reading p {
  margin: .65rem 0 0;
}

.reading h2 {
  margin-top: 1.4rem;
}

.reading h2:first-child {
  margin-top: 0;
}

.reading ol {
  padding-left: 1.35rem;
}

.reading code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--green);
  background: var(--pale);
  padding: .1rem .3rem;
  border-radius: 4px;
}

.practice {
  max-width: 820px;
  margin: 0 auto;
}

.exercise-panel {
  padding: clamp(1.25rem,4vw,3rem);
  margin-top: .85rem;
}

.course-picker {
  max-width: 800px;
  padding-top: clamp(2rem, 7vh, 5rem);
}

.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.course-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--forest);
  text-decoration: none;
}

.course-link:hover, .course-link:focus-visible {
  background: var(--pale);
  border-color: var(--green);
}

.course-link span {
  color: var(--sub);
  font: 1.1rem var(--serif);
}

.course-link strong {
  grid-column: 1;
  font-size: 1.35rem;
}

.course-link i {
  grid-column: 2;
  grid-row: 1 / 3;
  padding-left: .6rem;
  font: 1.55rem var(--sans);
}

.round-cheer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5rem, 24%);
  align-items: center;
  gap: clamp(.65rem, 2vw, 1.5rem);
}

.round-saying {
  color: var(--forest);
  margin: 0;
  font: 700 clamp(1.7rem, 4.3vw, 2.75rem)/1.15 var(--serif);
  overflow-wrap: anywhere;
}

.round-translation {
  margin: .5rem 0 .15rem;
  font-size: 1.05rem;
}

.round-source {
  font-size: .85rem;
  color: var(--sub);
}

.round-illustration {
  display: block;
  width: 100%;
  height: auto;
}

.exercise-meta {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--pale);
  color: var(--green);
  padding: .25rem .65rem;
  border-radius: 6px;
  font-size: .88rem;
}

.sentence {
  margin: 1.65rem 0 .7rem;
  font: 600 clamp(1.9rem,4.4vw,3rem)/1.48 var(--serif);
  overflow-wrap: anywhere;
}

.blank {
  display: inline-block;
  vertical-align: baseline;
  min-width: 3em;
  border-bottom: 3px solid #a97c32;
  line-height: .95;
  color: transparent;
  background: #f7edd4;
  border-radius: .12em;
}

.answer {
  background: #e2efd9;
  color: #234d32;
  border-radius: .12em;
  padding: 0 .08em;
}

.answer.miss {
  background: #feead5;
  color: #7e4129;
}

.translation {
  font-size: 1.12rem;
  color: var(--sub);
  margin: .45rem 0 1.4rem;
}

.control-area {
  border-top: 1px solid var(--line);
  padding-top: 1.05rem;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.mode-switch .toggle {
  min-height: 40px;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin: 1rem 0;
}

.option {
  display: flex;
  align-items: center;
  border: 1px solid #c3cfc0;
  background: white;
  border-radius: 9px;
  padding: .7rem .9rem;
  gap: .7rem;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: left;
  min-height: 49px;
  font-weight: 550;
}

.option:hover:enabled {
  border-color: var(--green);
  background: var(--pale);
}

.option:disabled {
  opacity: 1;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: .1rem .7rem;
  align-content: center;
}

.option small {
  grid-column: 2;
  font-size: .76rem;
}

.option.is-correct {
  color: var(--green);
  border-color: #628060;
  background: #edf3e8;
}

.option.is-wrong {
  color: var(--warn);
  border-color: #b57d5d;
  background: #fff0de;
}

.option b {
  font: 600 .81rem/1.55 var(--sans);
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 1.55rem;
  text-align: center;
  color: var(--sub);
  background: white;
  flex: none;
}

.entry {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid #9eaf9e;
  border-radius: 8px;
  margin: .35rem 0 .3rem;
  min-height: 48px;
}

.entry-label {
  display: block;
  margin-top: 1rem;
  font-size: .9rem;
  font-weight: 650;
}

.submit-row {
  margin-top: 1rem;
}

.feedback {
  border-radius: 10px;
  padding: 1rem 1.15rem;
  background: #edf3e8;
}

.feedback.miss {
  background: #fff0de;
}

.feedback h2 {
  font-size: 1.1rem;
  margin: 0 0 .2rem;
}

.feedback p {
  margin: .2rem 0;
}

.source {
  margin: 1rem 0;
  color: var(--sub);
  font-size: .875rem;
}

.source a {
  overflow-wrap: anywhere;
}

.source span {
  display: inline-block;
  margin-right: .8rem;
}

.history-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: .6rem 0;
  font-size: .95rem;
}

.range-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.progress-note {
  margin: 1rem 0 1.4rem;
}

.actions {
  display: flex;
  gap: .65rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

#main h1:focus,.sentence:focus,.feedback:focus {
  outline: none;
}

@media(max-width:850px) {
  .mast-inner,.wrap,.sitefoot {
    width: min(calc(100% - 3rem),1140px);
  }
  .mast-inner {
    gap: 1.7rem;
  }
  .hero-copy {
    padding: 1.8rem 2rem;
  }
  .panel {
    padding: 1.35rem;
  }
  .home-grid {
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
  }
  .stat-grid>div {
    padding-left: .6rem;
  }
}

@media(max-width:660px) {
  .mast-inner,.wrap,.sitefoot {
    width: calc(100% - 2rem);
  }
  .mast-inner {
    min-height: 62px;
    gap: 1rem;
    justify-content: space-between;
  }
  .brand {
    font-size: 1.33rem;
    gap: .45rem;
    white-space: nowrap;
  }
  .brand img {
    width: 33px;
    height: 33px;
    border-radius: 8px;
  }
  .pair {
    display: none;
  }
  .mast nav {
    gap: 1rem;
  }
  .mast nav a {
    font-size: .9rem;
    min-height: 46px;
  }
  .wrap {
    padding-top: 1.3rem;
  }
  .heading {
    margin-bottom: .8rem;
  }
  .heading h1 {
    font-size: 1.48rem;
  }
  .date {
    font-size: .8rem;
  }
  .hero {
    min-height: 235px;
    border-radius: 14px;
  }
  .hero-copy {
    padding: 1.45rem;
    width: 72%;
  }
  .hero h2 {
    font-size: clamp(1.8rem,7.9vw,2.8rem);
    white-space: nowrap;
  }
  .hero p {
    font-size: .91rem;
    margin-bottom: 1.05rem;
  }
  .hero-art {
    width: 40%;
    height: 80%;
    right: -4%;
    top: 54%;
  }
  .hero-k {
    font-size: .8rem;
  }
  .home-grid,.history-list {
    grid-template-columns: 1fr;
  }
  .home-grid {
    margin: 1rem 0;
  }
  .panel {
    padding: 1.15rem;
  }
  .stat-grid {
    margin: 1.1rem 0;
  }
  .toggle {
    min-height: 44px;
  }
  .stat-grid strong {
    font-size: 1.9rem;
  }
  .sitefoot {
    padding-bottom: max(1rem,env(safe-area-inset-bottom));
  }
  .exercise-panel {
    margin-top: .6rem;
  }
  .options {
    gap: .5rem;
  }
  .mode-row {
    gap: .45rem;
  }
  .heading .textbtn {
    font-size: .85rem;
  }
}

@media(max-width:390px) {
  .mast nav {
    gap: .65rem;
  }
  .hero-copy {
    padding: 1.12rem;
    width: 77%;
  }
  .hero-art {
    width: 35%;
    right: -5%;
  }
  .hero {
    min-height: 216px;
  }
  .seg-row {
    gap: .3rem;
  }
  .toggle {
    padding: .4rem .6rem;
  }
  .mode-row .ico {
    display: none;
  }
  .section-head {
    gap: .3rem;
  }
}

@media(prefers-reduced-motion:no-preference) {
  button {
    transition: background-color .12s,border-color .12s;
  }
}

.hero-alt {
  margin-left: .75rem;
  border: none;
  color: #edf4e9;
  background: none;
  text-underline-offset: 4px;
  text-decoration: underline;
  min-height: 44px;
}
