:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #29413c;
  background: #f6f9f8;
  font-synthesis: none;
  line-height: 1.6;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #80b8ad;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.lab-header {
  min-height: 62px;
  background: white;
  border-bottom: 1px solid #e0e8e4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px max(20px, calc((100vw - 1080px) / 2));
}
.brand {
  color: #2a6e5c;
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
}
.brand span {
  font-size: 12px;
  color: #90a39b;
  font-weight: 400;
}
.progress {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #8d9e96;
}
.progress > span:first-child {
  color: #e9ad43;
  font-size: 20px;
}
.progress strong {
  color: #886626;
  font-size: 18px;
}
main {
  max-width: 1080px;
  margin: auto;
  padding: 28px 20px 0;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 12px;
  color: #90a49b;
  margin: 0 0 4px;
}
h1 {
  font-size: 28px;
  margin: 0;
  line-height: 1.4;
}
.subject-mark {
  font-size: 35px;
  color: #94bdad;
  word-spacing: 12px;
}
.subject-mark span {
  color: #b99bc3;
}
h2 {
  font-size: 17px;
  margin: 0;
}
h3 {
  font-size: 21px;
  line-height: 1.6;
  margin: 18px 0 12px;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #dbe6e0;
  gap: 28px;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 2px;
  color: #869b90;
  font-size: 14px;
}
.tabs button[aria-pressed="true"] {
  color: #227961;
  border-bottom-color: #328d72;
  font-weight: 700;
}
.lesson-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 0 18px;
}
.lesson-bar select,
select {
  border: 1px solid #d4e1d9;
  background: white;
  color: #587467;
  border-radius: 5px;
  padding: 7px;
  font-size: 12px;
  max-width: 100%;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.visual-column {
  min-width: 0;
  background: #edf3f1;
  border-radius: 6px;
  padding: 22px;
}
.visual-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #748d80;
  margin-bottom: 16px;
}
.visual-caption strong {
  font-size: 20px;
  color: #3c7260;
}
.visual-caption label {
  display: flex;
  align-items: center;
  gap: 5px;
}
canvas {
  width: 100%;
  height: 270px;
  display: block;
}
#area-caption {
  min-height: 48px;
}
.concept {
  font-size: 13px;
  color: #638274;
  line-height: 1.9;
  margin: 16px 0;
}
.custom-problem {
  display: flex;
  align-items: end;
  gap: 8px;
  border-top: 1px solid #d4e2d9;
  padding-top: 16px;
  flex-wrap: wrap;
}
.custom-problem label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #7f9488;
}
.custom-problem input {
  width: 64px;
  min-height: 38px;
  background: white;
  border: 1px solid #d3e2d8;
  border-radius: 4px;
  padding: 5px;
  color: #395b4a;
}
.custom-problem button,
.quiet {
  border: 1px solid #cbdcd2;
  background: white;
  color: #678674;
  padding: 8px 11px;
  border-radius: 4px;
  font-size: 12px;
  min-height: 38px;
}
.inline-error {
  font-size: 12px;
  color: #aa624c;
  margin-bottom: 0;
}
.calculation-column {
  min-width: 0;
  padding: 6px 0 12px;
}
.step-heading {
  display: flex;
  justify-content: space-between;
  color: #7c9487;
  font-size: 12px;
}
.vertical {
  display: grid;
  justify-content: end;
  margin: 16px auto 22px;
  width: min(330px, 100%);
  font-family: ui-monospace, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}
.number-row {
  display: grid;
  grid-template-columns: 24px repeat(6, 32px);
  min-height: 36px;
  align-items: center;
  text-align: center;
  font-size: 25px;
  line-height: 1.2;
}
.number-row.line {
  border-top: 2px solid #718f80;
  padding-top: 7px;
}
.number-row.sum {
  border-top: 2px solid #718f80;
  margin-top: 5px;
  padding-top: 6px;
  color: #24836b;
}
.number-row.partial {
  color: #6f9b88;
}
.number-row .active-cell {
  background: #e2eee7;
  border: 1px dashed #81b296;
  border-radius: 4px;
  min-height: 30px;
  color: #3c8765;
}
.shift-zero {
  color: #b6c1b9;
  font-size: 19px;
}
.carry-row {
  font-size: 12px;
  color: #bd8950;
  min-height: 20px;
}
.digit-inputs {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}
.digit-inputs label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #759080;
}
.digit-inputs input {
  width: 84px;
  height: 54px;
  text-align: center;
  font-size: 28px;
  color: #39775d;
  border: 1px solid #b7d4c2;
  border-radius: 5px;
  background: #f8fcfa;
}
.sum-label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #71917c;
  margin: 16px 0;
}
.sum-label input {
  width: 180px;
  max-width: 100%;
  height: 48px;
  border: 1px solid #b7d4c2;
  border-radius: 5px;
  font-size: 25px;
  padding: 8px 12px;
  color: #39775d;
}
#step-prompt {
  font-size: 14px;
  min-height: 44px;
  line-height: 1.8;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.primary {
  border: 0;
  background: #34866c;
  color: white;
  padding: 11px 18px;
  border-radius: 5px;
  font-weight: 650;
  font-size: 13px;
  min-height: 43px;
}
.primary:hover {
  background: #287357;
}
.primary:disabled {
  background: #adc6b8;
  cursor: default;
}
.feedback {
  min-height: 62px;
  margin-top: 15px;
  font-size: 13px;
  color: #6c8877;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.feedback.wrong {
  color: #ac6b4d;
}
.feedback.correct {
  color: #2e8766;
}
.next {
  background: none;
  border: 0;
  border-bottom: 1px solid #bdd4c5;
  padding: 9px 0;
  color: #739780;
  font-size: 12px;
}
.task-badge {
  font-size: 11px;
  color: #9a8557;
  background: #f6efdd;
  border-radius: 4px;
  padding: 4px 7px;
}
.task-copy {
  font-size: 13px;
  color: #8a9e90;
  line-height: 1.9;
}
.knowledge {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e1e9e3;
  padding: 19px 0;
  margin: 16px 0;
  color: #93a394;
  font-size: 12px;
}
.knowledge strong {
  color: #6c8f77;
  font-weight: 600;
}
.chocolate {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), 1fr);
  gap: 6px;
  max-width: 360px;
  margin: 20px auto;
  aspect-ratio: 1.5;
  background: #c5ad99;
  border: 7px solid #c5ad99;
  border-radius: 6px;
}
.chocolate button {
  border: 1px solid #a78d75;
  border-radius: 4px;
  background: #d9c8b9;
  box-shadow:
    inset 3px 3px #eee1d35c,
    inset -3px -3px #ac917a40;
  min-width: 0;
  min-height: 38px;
  color: #9a7f6a;
  font-size: 16px;
  touch-action: manipulation;
}
.chocolate button[aria-pressed="true"] {
  background: #7c5b49;
  border-color: #634334;
  color: #ffefda;
  box-shadow:
    inset 3px 3px #c1947055,
    inset -3px -3px #51352460;
}
.fraction-readout {
  display: grid;
  justify-content: center;
  text-align: center;
  gap: 1px;
  font-size: 28px;
  color: #795c47;
  font-variant-numeric: tabular-nums;
}
.fraction-line {
  height: 2px;
  background: #987b66;
  width: 48px;
}
.hundred-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  max-width: 340px;
  aspect-ratio: 1;
  margin: 16px auto;
  background: #d8e4de;
  padding: 6px;
  border-radius: 5px;
}
.hundred-grid button {
  padding: 0;
  border: 0;
  border-radius: 1px;
  min-width: 0;
  background: #fff;
  touch-action: manipulation;
}
.hundred-grid button.filled {
  background: #5d9f85;
}
.hundred-grid button:nth-child(10n + 1) {
  border-left: 1px solid #a3bcae;
}
.range-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #799681;
  margin-top: 18px;
}
.range-label output {
  font-size: 20px;
  color: #387b5b;
  font-weight: 700;
}
input[type="range"] {
  width: 100%;
  accent-color: #509174;
  min-height: 36px;
  cursor: pointer;
}
.ruler {
  display: flex;
  justify-content: space-between;
  color: #93a99b;
  font-size: 11px;
}
.place-values {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 26px 0 16px;
}
.place-values > div {
  display: grid;
  text-align: center;
  gap: 8px;
  min-width: 58px;
}
.place-values span {
  font-size: 11px;
  color: #93a599;
}
.place-values div b {
  font-size: 32px;
  font-weight: 600;
  padding: 9px;
  background: #edf4ef;
  border-radius: 5px;
  color: #4b8468;
}
.decimal-point {
  font-size: 30px;
  line-height: 1.5;
  color: #88a18f;
}
.equality {
  font-size: 17px;
  color: #618871;
  margin-bottom: 24px;
  font-family: ui-monospace, monospace;
}
.whole-units {
  font-size: 12px;
  color: #5d8b72;
  min-height: 20px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e2eae5;
  margin-top: 30px;
  padding: 17px 0 22px;
  font-size: 11px;
  color: #9caca0;
}
body > a[aria-label] {
  opacity: 0.9;
}
@media (max-width: 760px) {
  main {
    padding: 22px 16px 0;
  }
  .lab-header {
    padding: 12px 16px;
  }
  .brand span {
    display: none;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .visual-column {
    padding: 18px;
  }
  .lesson-bar {
    align-items: start;
  }
  .lesson-bar h2 {
    font-size: 15px;
  }
  .lesson-bar select {
    max-width: 155px;
  }
  .tabs {
    gap: 24px;
  }
  .tabs button {
    font-size: 13px;
  }
  .heading h1 {
    font-size: 25px;
  }
  canvas {
    height: 240px;
  }
  .calculation-column {
    padding: 0 4px;
  }
  .vertical {
    justify-content: center;
  }
  .chocolate {
    max-width: 360px;
  }
  .hundred-grid {
    max-width: 340px;
  }
  .subject-mark {
    font-size: 28px;
  }
  .feedback {
    min-height: 44px;
  }
  .number-row {
    grid-template-columns: 24px repeat(6, 30px);
  }
  footer {
    padding-bottom: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
