:root {
  --ink: #17324d;
  --muted: #64748b;
  --paper: #fffdf7;
  --sky: #dff4ff;
  --sky-deep: #45a7e8;
  --leaf: #49b86f;
  --leaf-soft: #ddf7e6;
  --sun: #ffbd3d;
  --peach: #ff8f70;
  --line: #d7e3ee;
  --soft: #f4f8fb;
  --danger: #e75757;
  --shadow: 0 18px 45px rgba(41, 83, 117, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(223, 244, 255, 0.95), rgba(221, 247, 230, 0.82)),
    #f7fbff;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 190px minmax(800px, 1024px);
  gap: 24px;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(69, 167, 232, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.brand-mark {
  padding: 8px 4px 14px;
  font-size: 22px;
  font-weight: 800;
}

.nav-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0 14px;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(69, 167, 232, 0.35);
  background: #ffffff;
}

.tablet-frame {
  width: 1024px;
  height: 768px;
  overflow: hidden;
  border: 12px solid #24384d;
  border-radius: 32px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(20, 49, 75, 0.28);
}

#screen-root,
.screen {
  width: 100%;
  height: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 34px 44px;
  background:
    radial-gradient(circle at top right, rgba(255, 189, 61, 0.22), transparent 30%),
    linear-gradient(180deg, #ffffff, #f6fbff);
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.title-block h1,
.title-block h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.title-block h1 {
  font-size: 48px;
}

.title-block h2 {
  font-size: 34px;
}

.title-block p,
.subtle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.status-strip {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 35px rgba(41, 83, 117, 0.1);
}

.lesson-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
}

.lesson-name {
  font-size: 34px;
  font-weight: 900;
  margin: 0 0 12px;
}

.lesson-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.meta-card {
  min-height: 96px;
  padding: 16px;
  border-radius: 16px;
  background: var(--soft);
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.word-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
}

.mini-word {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-weight: 800;
}

.mini-word span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.button-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.button {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(41, 83, 117, 0.1);
}

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

.button.secondary {
  background: var(--sky);
  border-color: #bfe8fb;
}

.button.soft {
  background: #fff3d7;
  border-color: #ffd98a;
}

.button.ghost {
  background: #ffffff;
}

.button:disabled {
  color: #9aa7b3;
  background: #edf2f6;
  cursor: not-allowed;
  box-shadow: none;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #bfe8fb;
  border-radius: 999px;
  color: var(--ink);
  background: var(--sky);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(41, 83, 117, 0.1);
}

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  background: #c9efff;
}

.erase-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #365875;
  background: #f7fbff;
  border-color: #b8d6eb;
  box-shadow: 0 8px 18px rgba(41, 83, 117, 0.1);
}

.erase-button:hover {
  color: var(--ink);
  background: #eaf6ff;
}

.content-center {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 34px;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.fruit-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(223, 244, 255, 0.88)),
    var(--sky);
  border: 1px solid #cdeaf8;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.42);
}

.fruit-card .sound-button {
  position: absolute;
  right: 22px;
  bottom: 22px;
  color: #245170;
  background: #ffffff;
  border-color: #83bee3;
  box-shadow:
    0 10px 22px rgba(36, 81, 112, 0.18),
    0 0 0 4px rgba(255, 255, 255, 0.72);
}

.fruit-card .sound-button:hover {
  background: #edf8ff;
}

.fruit-emoji {
  font-size: 150px;
  line-height: 1;
}

.learn-copy,
.practice-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.word-en {
  margin: 0;
  font-size: 76px;
  line-height: 1;
  font-weight: 900;
}

.word-cn {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
}

.phonetic {
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
}

.progress-bar {
  width: 260px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3edf5;
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 340px;
  justify-content: flex-end;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--leaf);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-slots {
  display: flex;
  gap: 10px;
  min-height: 64px;
}

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-bottom: 5px solid var(--sky-deep);
  border-radius: 10px 10px 4px 4px;
  background: #ffffff;
  font-size: 30px;
  font-weight: 900;
}

.letters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 430px;
}

.letter-button {
  width: 64px;
  height: 58px;
  border: 1px solid #b8d6eb;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(41, 83, 117, 0.1);
}

.letter-button.selected {
  color: #ffffff;
  background: var(--sky-deep);
  border-color: var(--sky-deep);
  box-shadow: none;
}

.feedback {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--leaf-soft);
  color: #247243;
  font-size: 18px;
  font-weight: 800;
}

.feedback.warn {
  color: #9b4c1c;
  background: #fff0d8;
}

.feedback.error {
  color: #a72f2f;
  background: #ffe5e5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-item {
  min-height: 116px;
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.stat-item span {
  color: var(--muted);
  font-weight: 800;
}

.stat-item strong {
  display: block;
  margin-top: 8px;
  font-size: 38px;
}

.mistake-list {
  display: grid;
  gap: 10px;
  max-height: 270px;
  overflow: auto;
}

.mistake-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.mistake-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--sky);
  font-size: 26px;
}

.mistake-row strong {
  display: block;
  font-size: 20px;
}

.mistake-row span {
  color: var(--muted);
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    width: min(1024px, 100%);
    flex-direction: row;
    justify-content: center;
    margin: 0 auto;
  }

  .brand-mark {
    display: none;
  }

  .tablet-frame {
    width: min(1024px, calc(100vw - 32px));
    height: min(768px, calc((100vw - 32px) * 0.75));
  }
}
