:root {
  --blue: #073f9e;
  --blue-deep: #062f83;
  --blue-soft: #eaf4ff;
  --line: #b8d8ff;
  --ink: #17315c;
  --muted: #6d7692;
  --gold: #ffd766;
  --green: #7bb58c;
  --shadow: 0 22px 55px rgba(16, 70, 150, .16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(189, 221, 255, .65), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(214, 234, 255, .85), transparent 28%),
    linear-gradient(180deg, #f8fcff 0%, #eef7ff 56%, #dceeff 100%);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: auto auto -18vh -8vw;
  width: 66vw;
  height: 38vh;
  background: radial-gradient(ellipse at center, rgba(92, 157, 230, .24), rgba(92, 157, 230, .08) 45%, transparent 70%);
  transform: rotate(-10deg);
  pointer-events: none;
}

.app-shell {
  width: min(1440px, 100vw);
  height: 100vh;
  margin: 0 auto;
  padding: 18px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  height: 86px;
  display: grid;
  grid-template-columns: 430px 1fr 90px;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; min-width: 420px; overflow: visible; }
.brand-logo {
  width: 418px;
  height: 86px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 16px rgba(25, 90, 180, .08));
}
.lesson-pill {
  min-width: 430px;
  text-align: center;
  padding: 14px 30px;
  color: var(--blue);
  font-size: 25px;
  font-weight: 900;
  border: 2px solid var(--line);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 white;
}
.version {
  justify-self: end;
  width: 74px; height: 66px;
  border-radius: 0 28px 0 28px;
  background: linear-gradient(145deg, #0c56bd, #032e93);
  color: white;
  font-weight: 900;
  font-size: 31px;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(6, 57, 150, .25);
}

.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 18px;
}

.sidebar {
  padding: 18px;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.74);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav-btn {
  border: 1.5px solid #c7defb;
  background: linear-gradient(180deg, #fff, #edf7ff);
  color: var(--blue);
  border-radius: 20px;
  min-height: 58px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.nav-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(11,70,160,.14); }
.nav-btn.active { background: linear-gradient(180deg, #0b58bd, #073895); color: white; border-color: #0b58bd; }

.screen {
  min-width: 0;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.76);
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: 26px;
  overflow: hidden;
  position: relative;
}
.screen::after {
  content: "";
  position: absolute;
  right: 22px; bottom: 18px;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 6px double var(--blue);
  background: rgba(255,255,255,.72);
  opacity: .14;
}

.footer {
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  color: var(--blue);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .1em;
  position: relative;
}
.footer small {
  position: absolute;
  bottom: -2px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--blue);
}

.home-grid { height: 100%; display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
.hero-copy h1 { margin: 0; color: var(--blue); font-size: clamp(54px, 6vw, 84px); line-height: 1.02; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.hero-copy p { font-size: 25px; line-height: 1.7; color: #36456c; margin: 24px 0 30px; }
.primary-btn, .soft-btn {
  border: 0; border-radius: 999px; padding: 18px 32px; font-size: 22px; font-weight: 900; cursor: pointer;
}
.primary-btn { background: linear-gradient(135deg, #0b5bc6, #073a99); color: white; box-shadow: 0 18px 30px rgba(7,64,158,.26); }
.soft-btn { background: #eef7ff; color: var(--blue); border: 1.5px solid var(--line); }
.hero-card-stack { position: relative; height: min(56vh, 520px); }
.hero-card-stack img { position: absolute; width: 78%; border-radius: 28px; box-shadow: 0 22px 50px rgba(20,80,170,.22); border: 5px solid white; }
.hero-card-stack img:nth-child(1) { right: 0; top: 4%; transform: rotate(2.5deg); }
.hero-card-stack img:nth-child(2) { left: 0; bottom: 6%; transform: rotate(-4deg); }

.section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-title h2 { margin: 0; color: var(--blue); font-size: 38px; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.section-title p { margin: 6px 0 0; color: var(--muted); font-size: 18px; }
.progress { display: flex; gap: 8px; align-items: center; font-weight: 900; color: var(--blue); }
.star { color: #f4b600; font-size: 24px; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; height: calc(100% - 84px); overflow: auto; padding-right: 8px; }
.lesson-card {
  height: 315px;
  border: 2px solid #d2e6ff;
  background: white;
  border-radius: 28px;
  padding: 10px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(16,78,165,.1);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}
.lesson-card:hover { transform: translateY(-5px) scale(1.01); box-shadow: 0 22px 42px rgba(16,78,165,.18); }
.lesson-card img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 20px; }
.lesson-card .badge { position: absolute; top: 18px; left: 18px; background: rgba(255,255,255,.92); color: var(--blue); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font-weight: 900; }

.action-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.action-tile {
  min-height: 155px;
  border: 2px solid #d2e6ff;
  background: linear-gradient(180deg, #fff, #f2f8ff);
  border-radius: 28px;
  display: grid; place-items: center;
  text-align: center;
  cursor: pointer;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(20,80,170,.1);
}
.action-char { font-size: 72px; color: var(--blue); font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-weight: 900; }
.action-hint { color: var(--muted); font-size: 18px; margin-top: 8px; }
.action-tile.active { background: linear-gradient(180deg, #eaf4ff, #fff); outline: 5px solid rgba(255,215,102,.55); }
.big-prompt { margin-top: 20px; padding: 24px; border-radius: 26px; border: 2px dashed var(--line); background: rgba(255,255,255,.72); font-size: 28px; color: var(--blue); font-weight: 900; text-align: center; }

.match-layout { display: grid; grid-template-columns: .92fr 1.28fr; gap: 18px; height: calc(100% - 58px); min-height: 0; }
.word-bank, .target-board { border-radius: 28px; background: #f8fcff; border: 1.5px solid var(--line); padding: 16px; min-height: 0; overflow: hidden; }
.word-bank h3, .target-board h3 { margin: 0 0 10px; color: var(--blue); font-size: 22px; }
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.draggable {
  min-width: 78px;
  padding: 14px 20px;
  border-radius: 18px;
  border: 2px solid #c6dcfb;
  background: white;
  color: var(--blue);
  font-size: 34px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-weight: 900;
  text-align: center;
  cursor: grab;
  box-shadow: 0 8px 16px rgba(12,65,145,.12);
}
.targets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; height: calc(100% - 34px); overflow-y: auto; overflow-x: hidden; padding: 0 10px 8px 0; align-content: start; }
.target {
  min-height: 72px;
  border: 2px dashed #aacdff;
  border-radius: 22px;
  background: white;
  padding: 10px 12px;
}
.target strong { display: block; color: var(--blue); font-size: 20px; margin-bottom: 6px; }
.drop-row { display: flex; gap: 9px; align-items: center; min-height: 40px; }
.slot { width: 49px; height: 39px; border-radius: 14px; background: #edf6ff; border: 1.5px solid #cfe4ff; display: grid; place-items: center; color: var(--blue); font-size: 28px; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-weight: 900; }
.target.done { border-style: solid; border-color: #79bf83; background: #f2fff4; }
.feedback { margin-top: 12px; color: #1e8a35; font-size: 22px; font-weight: 900; min-height: 30px; }
.match-screen { padding: 18px 22px 16px; }
.match-screen .section-title { margin-bottom: 10px; align-items: center; }
.match-screen .section-title h2 { font-size: 32px; }
.match-screen .section-title p { font-size: 15px; margin-top: 2px; }
.match-screen .soft-btn { padding: 13px 24px; font-size: 19px; }
.match-screen .word-bank, .match-screen .target-board { padding: 16px; }
.match-screen .word-bank h3, .match-screen .target-board h3 { font-size: 21px; margin-bottom: 8px; }
.match-screen .draggable { min-width: 70px; padding: 12px 18px; font-size: 34px; }


.speak-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; height: calc(100% - 80px); }
.speak-card { border-radius: 30px; background: white; border: 2px solid var(--line); padding: 14px; box-shadow: 0 16px 32px rgba(20,80,170,.12); }
.speak-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 22px; }
.sentence-panel { border-radius: 30px; background: #f8fcff; border: 1.5px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.sentence { font-size: 34px; color: var(--blue); font-weight: 900; padding: 18px 22px; border-radius: 22px; background: white; border: 1.5px solid #d4e8ff; }
.sentence .blank { display: inline-block; min-width: 150px; border-bottom: 4px solid var(--blue); }

.modal { position: fixed; inset: 0; background: rgba(6,32,88,.74); display: none; place-items: center; z-index: 10; padding: 28px; }
.modal.show { display: grid; }
.modal img { max-width: 92vw; max-height: 88vh; border-radius: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.38); background: white; }
.modal-close { position: fixed; top: 24px; right: 30px; width: 54px; height: 54px; border: 0; border-radius: 50%; background: white; color: var(--blue); font-size: 38px; cursor: pointer; }

@media (max-width: 1000px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .topbar { grid-template-columns: 1fr; height: auto; }
  .lesson-pill { min-width: 0; }
  .stage { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; }
  .nav-btn { min-width: 140px; }
  .card-grid, .home-grid, .match-layout, .speak-grid { grid-template-columns: 1fr; height: auto; }
  .action-board { grid-template-columns: repeat(2, 1fr); }
}

.game-screen {
  padding: 20px 24px 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(190, 225, 255, .58), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(242,249,255,.82));
}
.game-scene {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 231, 142, .35), transparent 16%),
    radial-gradient(circle at 16% 78%, rgba(160, 210, 255, .36), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
  border: 2px solid #c8e0ff;
}
.game-scene::before {
  content: "";
  position: absolute;
  left: -8%; right: -8%; bottom: -14%; height: 30%;
  background: radial-gradient(ellipse at center, rgba(120, 190, 225, .26), rgba(120, 190, 225, .08) 58%, transparent 70%);
  transform: rotate(-2deg);
}
.game-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.game-level {
  display: inline-flex;
  color: var(--blue);
  background: rgba(255,255,255,.78);
  border: 1.5px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 900;
}
.game-topline h2 {
  margin: 12px 0 5px;
  color: var(--blue);
  font-size: 44px;
  line-height: 1.06;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.game-topline p { margin: 0; color: #50607e; font-size: 19px; font-weight: 700; }
.star-counter {
  min-width: 210px;
  text-align: right;
  color: #f2b300;
  text-shadow: 0 3px 0 rgba(255,255,255,.9);
  font-size: 34px;
  letter-spacing: .06em;
}
.game-main {
  position: relative;
  z-index: 1;
  height: calc(100% - 142px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 18px;
}
.game-visual {
  position: relative;
  min-height: 0;
  border-radius: 30px;
  border: 2px solid #d5e9ff;
  background: rgba(255,255,255,.78);
  box-shadow: 0 14px 28px rgba(17,80,160,.11);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 18px;
}
.game-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  filter: drop-shadow(0 12px 18px rgba(20,80,160,.12));
}
.panda-guide {
  position: absolute;
  left: 20px;
  bottom: 18px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  border: 2px solid #cfe5ff;
  display: grid;
  place-items: center;
  font-size: 42px;
  box-shadow: 0 10px 22px rgba(15,80,165,.13);
}
.panda-guide small {
  display: block;
  margin-top: -18px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}
.sky-clouds {
  width: 100%; height: 100%;
  position: relative;
  background: linear-gradient(180deg, #e7f5ff, #ffffff 60%, #edf9ff);
  border-radius: 24px;
}
.sky-clouds span {
  position: absolute;
  min-width: 112px;
  height: 82px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 56px;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 2px solid #cce3ff;
  box-shadow: 0 12px 28px rgba(20,80,160,.13);
}
.sky-clouds span:nth-child(1) { left: 15%; top: 22%; }
.sky-clouds span:nth-child(2) { right: 16%; top: 17%; }
.sky-clouds span:nth-child(3) { left: 24%; bottom: 20%; }
.sky-clouds span:nth-child(4) { right: 21%; bottom: 24%; }
.floating-tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #f8fcff, #ffffff);
  border-radius: 24px;
}
.floating-tiles span {
  width: 130px; height: 130px;
  display: grid; place-items: center;
  color: var(--blue);
  background: white;
  border: 2px solid #cce3ff;
  border-radius: 34px;
  font-size: 78px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(16,80,165,.13);
}
.floating-tiles b { color: var(--blue); font-size: 54px; }
.game-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-content: center;
}
.game-option {
  min-height: 88px;
  border: 2px solid #bddcff;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #eff8ff);
  color: var(--blue);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 42px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15,80,165,.11);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.game-option:hover { transform: translateY(-3px); box-shadow: 0 18px 32px rgba(15,80,165,.18); }
.game-option.correct { background: linear-gradient(180deg, #eaffef, #ffffff); border-color: #65be75; color: #198a32; animation: pop .38s ease; }
.game-option.wrong { background: linear-gradient(180deg, #fff0f0, #ffffff); border-color: #ff9c9c; color: #c13b3b; animation: shake .42s ease; }
.game-feedback {
  position: absolute;
  z-index: 2;
  left: 28px;
  right: 28px;
  bottom: 18px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
  background: rgba(255,255,255,.76);
  border: 1.5px solid #d3e8ff;
  border-radius: 999px;
}
.game-feedback.good { color: #198a32; }
.game-complete {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,226,126,.42), transparent 20%),
    linear-gradient(180deg, #ffffff, #eef8ff);
  border: 2px solid #cbe3ff;
}
.panda-badge { font-size: 92px; filter: drop-shadow(0 12px 18px rgba(15,80,165,.16)); }
.game-complete h2 {
  margin: 10px 0 0;
  color: var(--blue);
  font-size: 62px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.game-complete p { margin: 0; color: #405174; font-size: 24px; font-weight: 800; }
.big-stars { color: #f2b300; font-size: 52px; letter-spacing: .08em; }
@keyframes pop { 50% { transform: scale(1.06); } }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); } }

@media (max-width: 1000px) {
  .game-main { grid-template-columns: 1fr; height: auto; }
  .game-scene { min-height: 720px; }
}
