:root {
  --ink: #172033;
  --muted: #627085;
  --page: #f6f8fb;
  --panel: #ffffff;
  --line: #dce4ef;
  --green: #16a36a;
  --green-dark: #0d7c4e;
  --yellow: #f5c542;
  --blue: #2f68d8;
  --pink: #e85d8f;
  --red: #d84949;
  --shadow: 0 18px 44px rgba(40, 52, 76, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fffdf7 0, #f2f6fb 48%, #eef5f2 100%);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 16px auto 32px;
  display: grid;
  gap: 14px;
}

.workbench,
.teacher-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.workbench {
  padding: 18px;
}

.app-head,
.teacher-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.lesson-pill,
.section-title span,
.comment-box span,
.field span,
.timer-card span,
.mode-card span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  color: #0d6044;
  background: #daf5e8;
  font-size: 13px;
  font-weight: 900;
}

h1 {
  margin-top: 10px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.app-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.mode-card {
  min-width: 132px;
  border: 1px solid #f2d681;
  border-radius: 8px;
  padding: 12px;
  background: #fff7d9;
  text-align: center;
}

.mode-card strong {
  display: block;
  margin-top: 6px;
  color: #704a07;
  font-size: 19px;
}

.main-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.reading-card,
.result-card,
.teacher-panel {
  border-radius: 8px;
}

.reading-card,
.result-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.reading-card {
  overflow: hidden;
}

.section-title {
  padding: 16px 16px 0;
}

.section-title h2 {
  margin-top: 9px;
  font-size: clamp(23px, 4vw, 34px);
  line-height: 1.14;
  letter-spacing: 0;
}

.storm-scene {
  position: relative;
  height: 150px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #c9d4df 0%, #7f8d9c 62%, #63717e 100%);
}

.sun {
  position: absolute;
  top: 28px;
  left: 11%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f8d869;
  box-shadow: 0 0 28px rgba(248, 216, 105, 0.55);
}

.cloud {
  position: absolute;
  height: 54px;
  border-radius: 999px;
  background: #303b4c;
  box-shadow:
    42px -15px 0 11px #263140,
    86px -2px 0 5px #364152,
    130px -12px 0 9px #252f3d;
}

.cloud-one {
  top: 26px;
  right: 18%;
  width: 150px;
}

.cloud-two {
  top: 54px;
  right: -20px;
  width: 190px;
  transform: scale(1.1);
}

.hill {
  position: absolute;
  right: -24px;
  bottom: -52px;
  width: 62%;
  height: 104px;
  border-radius: 50% 50% 0 0;
  background: #425442;
}

.village {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 16px;
  display: flex;
  gap: 9px;
  align-items: end;
}

.village span {
  display: block;
  width: 44px;
  height: 32px;
  clip-path: polygon(0 38%, 50% 0, 100% 38%, 100% 100%, 0 100%);
  background: #e7ece9;
  opacity: 0.86;
}

.tree {
  position: absolute;
  bottom: 14px;
  width: 48px;
  height: 72px;
  background:
    linear-gradient(90deg, transparent 44%, #263021 45% 56%, transparent 57%),
    radial-gradient(circle at 50% 20%, #1f3527 0 27px, transparent 28px),
    radial-gradient(circle at 35% 44%, #26432e 0 23px, transparent 24px),
    radial-gradient(circle at 65% 45%, #203826 0 22px, transparent 23px);
}

.tree-left {
  left: 4%;
}

.tree-right {
  right: 10%;
  transform: scale(0.88);
}

.reading-text {
  padding: 16px;
  color: #101828;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.82;
  letter-spacing: 0;
}

.word-focus {
  margin: 0 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-focus span {
  min-height: 34px;
  border: 1px solid #f2d681;
  border-radius: 8px;
  padding: 6px 10px;
  color: #714a04;
  background: #fff7d9;
  font-weight: 900;
}

.recorder {
  margin: 0 16px 16px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.timer-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.timer-card strong {
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #e7edf5;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
  transition: width 0.12s linear;
}

.button-row,
.demo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button,
.secondary-button,
.retry-button,
.ghost-button,
.demo-tools button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--green);
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button,
.ghost-button,
.demo-tools button {
  color: var(--ink);
  background: #eef4fb;
  border-color: var(--line);
}

.compact {
  min-height: 40px;
}

.playback {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
}

.status-text {
  margin: 0 16px 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.status-text.is-error {
  color: var(--red);
  font-weight: 900;
}

.result-card {
  padding-bottom: 16px;
}

.star-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.star-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.star-item h3 {
  font-size: 18px;
  line-height: 1.25;
}

.star-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.star-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid #d8e1eb;
  border-radius: 50%;
  color: #9aa7b6;
  background: #fff;
  font-size: 34px;
  line-height: 1;
}

.star-item.is-on {
  border-color: #f0ce5e;
  background: #fff9df;
}

.star-item.is-on .star-icon {
  border-color: #efc94d;
  color: #f1b907;
  background: #fff4be;
}

.praise-box,
.comment-box,
.transcript-panel {
  margin: 0 16px 12px;
  border-radius: 8px;
}

.praise-box {
  border: 1px solid #b8e9cd;
  padding: 12px;
  color: #0d6044;
  background: #e4f8ec;
  font-weight: 900;
}

.comment-box {
  border: 1px solid #ead58c;
  padding: 13px;
  background: #fff9df;
}

.comment-box p {
  margin-top: 9px;
  white-space: pre-line;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.6;
}

.retry-button {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  color: #fff;
  background: var(--blue);
}

.transcript-panel {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #f8fbff;
}

.transcript-panel summary {
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.transcript-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.teacher-panel {
  padding: 16px;
}

.teacher-head h2 {
  margin-top: 8px;
  font-size: 26px;
}

.teacher-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.qr-card {
  display: grid;
  min-height: 250px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.qr-card img {
  width: 220px;
  height: 220px;
}

.qr-fallback {
  padding: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.setting-stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 104, 216, 0.13);
}

.demo-tools {
  border: 1px dashed #c7d3e2;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}

@media (max-width: 860px) {
  .app-head,
  .main-grid,
  .teacher-head,
  .teacher-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    text-align: left;
  }

  .storm-scene {
    height: 128px;
  }

  .reading-text {
    line-height: 1.72;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100vw - 18px, 1180px);
    margin-top: 9px;
  }

  .workbench,
  .teacher-panel {
    padding: 10px;
  }

  .button-row,
  .demo-tools {
    display: grid;
  }

  .primary-button,
  .secondary-button,
  .retry-button,
  .ghost-button,
  .demo-tools button {
    width: 100%;
  }

  .star-item {
    grid-template-columns: 46px 1fr;
    min-height: 78px;
  }

  .star-icon {
    width: 44px;
    height: 44px;
    font-size: 29px;
  }
}
