
:root{
  --blue:#245a86; --brown:#704312; --cream:#fff9e9; --sky:#eaf9ff; --gold:#f0a51e; --line:#b3dff3;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:linear-gradient(90deg,#d9f5ff,#fffdf7 12%,#fffdf7 88%,#d9f5ff);
  color:var(--blue);
}
a{text-decoration:none;color:inherit}
.page{max-width:1180px;margin:0 auto;padding:24px}
.topbar{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:14px 24px;margin:-24px -24px 20px;
  background:rgba(255,253,247,.92);backdrop-filter:blur(10px);
  border-bottom:3px solid rgba(179,223,243,.45);
}
.brand{display:flex;align-items:center;gap:14px}
.logo{
  width:74px;height:74px;border-radius:24px;display:grid;place-items:center;
  background:linear-gradient(180deg,#fff8df,#f3cf7d);
  color:var(--blue);font-family:Georgia,serif;font-size:25px;font-weight:1000;
  border:5px solid #fff;
}
.brand h1{font-size:clamp(24px,4vw,42px);margin:0;line-height:1.1}
.brand p{margin:4px 0 0;color:#6b7f8f;font-weight:900}
.nav-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
button,.btn{
  border:0;border-radius:24px;padding:14px 20px;font-size:1.05rem;font-weight:1000;cursor:pointer;
  box-shadow:0 12px 26px rgba(36,90,134,.13);
}
.primary{background:linear-gradient(180deg,#ffcc4d,#f0a51e);color:white}
.secondary{background:#fff;border:4px solid var(--line);color:var(--blue)}
.card{
  background:linear-gradient(180deg,#fffdf7,#f7fdff);
  border:6px solid #fff;
  border-radius:36px;
  padding:28px;
  box-shadow:0 20px 48px rgba(36,90,134,.12);
  margin:20px 0;
}
.hero{display:grid;grid-template-columns:1fr minmax(260px,42%);gap:24px;align-items:center}
.hero h2{font-size:clamp(36px,6vw,68px);margin:0 0 16px;color:var(--blue);line-height:1.06}
.hero p{font-size:1.25rem;line-height:1.8;color:#5c6e7b;font-weight:900}
.hero img{width:100%;border-radius:34px;border:6px solid white;box-shadow:0 18px 44px rgba(36,90,134,.16)}
.badge{display:inline-flex;padding:8px 16px;border-radius:999px;background:#8757e8;color:white;font-weight:1000;margin-bottom:12px}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.level-card{
  position:relative;min-height:245px;padding:18px;border-radius:32px;background:linear-gradient(180deg,#fff9e9,#eaf9ff);
  border:6px solid white;box-shadow:0 16px 36px rgba(36,90,134,.14);display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;
}
.level-card.unlocked{outline:5px solid rgba(243,207,125,.65)}
.level-card.locked{opacity:.68;filter:saturate(.75)}
.level-num{
  position:absolute;top:10px;left:10px;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(180deg,#f3cf7d,#c9903e);color:white;border:4px solid #fff8df;font:1000 24px Georgia,serif;
}
.level-card img{width:100%;height:105px;object-fit:cover;border-radius:22px;margin-bottom:4px}
.level-card strong{font-size:1.35rem;color:var(--brown)}
.level-card em{font-style:normal;font-weight:1000;color:var(--blue)}
.level-card small{font-weight:900;color:#6b7f8f}
.level-card b{margin-top:auto;padding:7px 14px;border-radius:999px;background:#fff8df;color:var(--brown)}
.lesson-hero{display:grid;grid-template-columns:minmax(250px,38%) 1fr;gap:24px;align-items:center}
.lesson-hero img,.story-layout img{width:100%;border-radius:30px;border:6px solid white;box-shadow:0 16px 34px rgba(36,90,134,.16)}
.lesson-title{font-size:clamp(34px,5vw,58px);margin:0;color:var(--blue)}
.step-title{font-size:clamp(28px,4vw,42px);color:var(--brown);margin:0 0 12px}
.task-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.task{background:#fffdf7;border:4px solid var(--line);border-radius:30px;padding:20px}
.task h3{font-size:1.45rem;color:var(--brown);margin:0 0 10px}
.options,.letter-bank,.game-options,.button-row{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}
.options button,.letter-bank button,.game-options button{
  background:linear-gradient(180deg,#fff4ca,#f3cf7d);color:var(--brown);border:4px solid #fff8df;border-radius:22px;
}
.letter-bank button:disabled{opacity:.35}
.answer-box{
  min-height:64px;padding:14px;border-radius:24px;background:var(--sky);border:4px dashed var(--line);
  font-size:clamp(32px,5vw,54px);font-weight:1000;text-align:center;letter-spacing:.07em;color:var(--blue);
}
.feedback,.muted{font-weight:1000;color:#5c6e7b;line-height:1.6}
.story-layout{display:grid;grid-template-columns:minmax(230px,34%) 1fr;gap:24px;align-items:start}
.story-text h3{font-size:clamp(34px,5vw,62px);line-height:1.14;margin:12px 0;color:var(--blue)}
.story-text .zh{font-size:1.3rem;color:var(--brown);font-weight:1000}
.story-count{display:inline-flex;padding:8px 16px;border-radius:999px;background:var(--sky);border:4px solid var(--line);font-weight:1000}
.story-list{background:#fff8df;border:4px dashed #f3cf7d;border-radius:26px;padding:16px;margin-top:16px}
.story-list h4{color:var(--brown);margin:0 0 8px;font-size:1.25rem}
.story-list ol{margin:0;padding-left:24px}
.story-list li{margin:8px 0;color:var(--blue);font-weight:1000}
.story-list li.active{color:var(--brown)}
.story-list button{background:transparent;box-shadow:none;padding:0;text-align:left;color:inherit}
.story-list small{display:block;color:#6b7f8f;margin-top:3px}
.coin-wallet{
  position:fixed;right:16px;top:16px;z-index:100;
  background:linear-gradient(180deg,#ffe38a,#f0a51e);color:#704312;border:5px solid #fff8df;border-radius:999px;
  padding:10px 16px;font-weight:1000;box-shadow:0 14px 34px rgba(36,90,134,.22);cursor:pointer;
}
.flying-coin{
  position:fixed;left:50%;top:52%;z-index:120;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(180deg,#ffe38a,#f0a51e);border:5px solid #fff8df;color:#704312;font-weight:1000;opacity:0;
}
.flying-coin.fly{animation:flyCoin .9s ease-out forwards}
@keyframes flyCoin{0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}25%{opacity:1;transform:translate(-50%,-85%) scale(1.1)}100%{opacity:0;transform:translate(42vw,-46vh) scale(.6) rotate(420deg)}}
.bubble-layer{position:fixed;inset:0;z-index:90;pointer-events:none;overflow:hidden}
.bubble-layer span{position:absolute;bottom:-30px;width:28px;height:28px;border-radius:50%;border:3px solid rgba(255,255,255,.9);background:rgba(179,223,243,.55);animation:bubbleUp 1.5s ease-out forwards}
@keyframes bubbleUp{0%{transform:translateY(0);opacity:0}20%{opacity:1}100%{transform:translateY(-80vh);opacity:0}}
.toast{
  position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);z-index:130;
  opacity:0;transition:.25s;background:#fff8df;border:5px solid white;border-radius:999px;padding:14px 22px;font-weight:1000;color:var(--blue);box-shadow:0 16px 38px rgba(36,90,134,.22);
}
.toast.show{opacity:1;transform:translateX(-50%)}
.shop-panel{position:fixed;inset:0;background:rgba(36,90,134,.35);z-index:140;display:none;align-items:center;justify-content:center;padding:20px}
.shop-panel.show{display:flex}
.shop-card{position:relative;width:min(92vw,680px);background:linear-gradient(180deg,#fff9e9,#eaf9ff);border:7px solid white;border-radius:36px;padding:28px;text-align:center;box-shadow:0 24px 60px rgba(36,90,134,.28)}
.shop-items{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:18px 0}
.shop-items button{background:#fffdf7;border:5px solid #fff8df;color:var(--brown)}
.close{position:absolute;right:16px;top:12px;width:44px;height:44px;border-radius:50%;padding:0;background:#fff8df;color:var(--brown);font-size:28px}
.parent-list{columns:2;line-height:2.1;font-size:1.25rem;font-weight:1000;color:#5d4a2b}
@media(max-width:900px){
  .grid,.task-grid{grid-template-columns:1fr 1fr}
  .hero,.lesson-hero,.story-layout{grid-template-columns:1fr}
}
@media(max-width:640px){
  .page{padding:14px}.topbar{margin:-14px -14px 14px;padding:12px}
  .grid,.task-grid,.shop-items{grid-template-columns:1fr}
  .nav-actions{justify-content:flex-start}
  .coin-wallet{top:auto;bottom:14px;right:14px}
  .parent-list{columns:1}
}
