:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #302943;
  background: #f5f4f0;
  font-size: 16px;
  font-synthesis: none;
  --muted: #655d73;
  --line: #ded8e8;
  --purple: #65529b;
  --purple-dark: #493775;
  --nav: #57488a;
  --yellow: #f6dc64;
  --tint: #e9e4f3;
  --paper: #fffefa;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: wait; opacity: .5; }
a { color: inherit; text-decoration: none; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
input:focus-visible { outline: none; background: var(--tint); }
::selection { background: var(--yellow); color: var(--purple-dark); }
[hidden] { display: none !important; }
.topbar { min-height: 76px; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--nav); color: var(--paper); }
.topbar :focus-visible { outline-color: var(--yellow); }
.brand { font-size: 20px; font-weight: 600; white-space: nowrap; }
nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.quiet, .pill { display: inline-flex; align-items: center; justify-content: center; padding: 10px 15px; border-radius: 8px; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.quiet { background: transparent; }
.quiet:hover { background: #6b5b9f; }
.pill { color: var(--purple-dark); background: var(--yellow); font-weight: 600; }
.pill:hover, .submit-idea:hover { background: #f1d250; }
.primary:hover { background: var(--purple-dark); }
#app { flex: 1; display: flex; flex-direction: column; position: relative; z-index: 1; }
#app.home-view { justify-content: center; padding: 64px 40px calc(min(100vw, 154.545vh) * .22 + 24px); }
.hero { width: min(100%, 1120px); margin: 0 auto; }
.hero h1 { font-size: clamp(28px, 3.3vw, 42px); font-weight: 650; text-align: center; letter-spacing: -.035em; line-height: 1.45; margin: 0 0 38px; text-wrap: balance; }
.home-entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-card { position: relative; display: flex; align-items: center; min-height: 240px; border-radius: 24px; padding: 32px 34px; overflow: hidden; isolation: isolate; transition: transform .18s ease, background .18s ease; }
.learning-card { background: #ffeda5; }
.creation-card { background: #e9e3f7; }
.home-card:hover { transform: translateY(-3px); }
.learning-card:hover { background: #ffe791; }
.creation-card:hover { background: #e2d9f3; }
.home-card-copy { position: relative; z-index: 1; align-self: flex-start; padding-top: 18px; }
.home-card-copy strong { display: block; font-size: clamp(28px, 3.1vw, 40px); font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
.home-card-copy > span { display: block; font-size: clamp(14px, 1.45vw, 18px); color: var(--muted); line-height: 1.6; margin-top: 12px; }
.home-card-art { position: absolute; z-index: 0; width: 48%; height: auto; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.card-arrow { position: absolute; right: 24px; bottom: 20px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 30px; line-height: 1; color: var(--purple-dark); background: #f9dc75; }
.creation-card .card-arrow { background: #d7c8ee; }
.home-links { display: flex; justify-content: center; gap: 44px; margin-top: 32px; }
.home-links a { padding: 5px 0; color: var(--nav); font-size: 17px; font-weight: 550; border-bottom: 1px solid currentColor; }
.home-links a:hover { color: #302943; }
.home-links span { margin-left: 8px; }
.text-link { display: inline-block; color: var(--purple-dark); text-decoration: underline; text-underline-offset: 5px; margin-top: 12px; }
.creation-intro > .muted { margin-bottom: 26px; }
.creation-handoff { padding: 24px; background: var(--tint); border-radius: 16px; margin: 24px 0 32px; }
.creation-handoff h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.creation-handoff p { font-size: 15px; line-height: 1.8; color: var(--muted); margin: 0 0 20px; }
.creation-handoff .pill { gap: 12px; }
.history .record-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 8px; margin: 0; }
.record-link:hover { background: var(--tint); }
.student-plan { width: min(100%, 1120px); }
.student-plan .btn { padding: 9px 14px; border-radius: 8px; background: var(--tint); color: var(--purple-dark); font-size: 14px; }
.student-plan .assessment-plan-selector .selected { background: var(--purple); color: white; }
.student-plan .form-note { color: var(--muted); font-size: 14px; }
.student-plan .assessment-report { margin-top: 20px; }
.composer { border: 0; border-radius: 14px; background: var(--tint); padding: 15px 16px 12px; width: 100%; }
.hero .composer { width: calc(100% - 32px); max-width: 620px; margin-inline: auto; padding: 12px 14px 10px; }
.composer:focus-within { background: #e5def0; }
.composer textarea { display: block; width: 100%; height: 60px; min-height: 60px; max-height: 240px; resize: vertical; border: 0; padding: 4px 5px; background: transparent; line-height: 1.7; border-radius: 7px; }
.hero .composer textarea { height: 40px; min-height: 40px; }
.composer textarea:focus, .composer textarea:focus-visible { outline: none; box-shadow: none; }
.composer textarea::placeholder { color: var(--muted); }
.composer-bottom { display: flex; justify-content: flex-end; padding-top: 5px; }
.submit-idea { width: 38px; height: 38px; padding: 0; border-radius: 10px; display: grid; place-items: center; background: var(--yellow); color: var(--purple-dark); }
.service-note { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 14px 0 0; text-align: center; }
.workspace { width: min(100%, 808px); margin: 34px auto 0; padding: 0 24px 40px; }
.workspace h1 { font-size: 26px; font-weight: 550; line-height: 1.5; margin: 24px 0; overflow-wrap: anywhere; }
.back { padding: 8px 0; background: transparent; color: var(--muted); font-size: 14px; }
.messages { display: flex; flex-direction: column; gap: 18px; margin: 28px 0 36px; }
.message { align-self: flex-end; max-width: 85%; background: var(--tint); border-radius: 14px; padding: 14px 20px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.history { list-style: none; margin: 16px 0 0; padding: 0; }
.history li { border-bottom: 1px solid var(--line); }
.history button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; background: transparent; padding: 20px 6px; }
.history button:hover { background: var(--tint); }
.history strong { display: block; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.history small { display: block; color: var(--muted); font-size: 14px; margin-top: 7px; }
.history .arrow { font-size: 20px; color: var(--muted); }
.history li > a { margin: 14px 0; }
.empty { padding: 48px 20px; line-height: 1.9; color: var(--muted); text-align: center; }
.section-label { font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 30px; }
.progress-list { padding-left: 22px; line-height: 1.8; }
.progress-list li { margin: 12px 0; }
.muted { color: var(--muted); line-height: 1.7; }
.error { color: #ab3049; font-size: 14px; line-height: 1.7; margin: 12px 0; }
.error:empty { display: none; }
.primary { background: var(--purple); color: #fff; border-radius: 10px; padding: 13px 20px; font-weight: 500; }
.full { width: 100%; }
dialog { border: 0; border-radius: 16px; padding: 32px; width: min(440px, calc(100vw - 32px)); color: #302943; background: var(--paper); box-shadow: 0 16px 64px #30294318; }
dialog::backdrop { background: #30294340; }
dialog h2 { font-size: 24px; font-weight: 550; margin: 0 0 20px; }
dialog p { font-size: 14px; line-height: 1.8; }
.close { position: absolute; right: 14px; top: 9px; font-size: 28px; background: transparent; color: var(--muted); padding: 7px; }
.login-tabs { display: flex; background: var(--tint); padding: 4px; border-radius: 10px; margin: 20px 0; }
.login-tabs button { flex: 1; background: transparent; border-radius: 9px; padding: 11px 8px; font-size: 14px; }
.login-tabs .active { background: var(--yellow); color: var(--purple-dark); font-weight: 600; }
#trial-note { color: var(--muted); margin: 0 0 22px; }
#number-field { display: block; font-size: 14px; line-height: 1.8; margin-bottom: 20px; }
#number-field input { display: block; width: 100%; margin-top: 8px; padding: 13px; border: 0; border-radius: 10px; background: var(--tint); }
#number-field input:focus { background: #e5def0; }
.student-code { padding: 18px 10px; background: var(--tint); font-family: ui-monospace, monospace; font-size: 18px; text-align: center; overflow-wrap: anywhere; border-radius: 12px; }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--purple-dark); color: #fff; padding: 12px 20px; max-width: 90%; border-radius: 12px; opacity: 0; pointer-events: none; z-index: 20; font-size: 14px; }
#toast.show { opacity: 1; }
@media (max-width: 600px) {
  .topbar { padding: 14px 16px; min-height: 68px; gap: 10px; flex-wrap: wrap; }
  nav { gap: 2px; margin-left: auto; }
  .quiet, .pill { padding: 10px 12px; }
  #app.home-view { padding: 40px 20px calc(min(100vw, 154.545vh) * .22 + 28px); }
  .hero h1 { font-size: 27px; margin-bottom: 28px; max-width: 340px; margin-inline: auto; }
  .home-entries { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-card { min-height: 176px; padding: 22px 24px; border-radius: 20px; }
  .home-card-copy { padding-top: 7px; }
  .home-card-copy strong { font-size: 29px; }
  .home-card-copy > span { font-size: 14px; margin-top: 8px; }
  .home-card-art { width: 43%; right: 10px; }
  .card-arrow { width: 34px; height: 34px; right: 18px; bottom: 15px; font-size: 25px; }
  .home-links { margin-top: 24px; gap: 28px; }
  .home-links a { font-size: 15px; }
  .workspace { padding: 0 20px 32px; margin-top: 18px; }
  .workspace h1 { font-size: 24px; }
  .message { max-width: 95%; }
  dialog { padding: 28px 24px; }
}
@media (min-width: 601px) and (max-width: 950px) {
  #app.home-view { padding-inline: 28px; }
  .home-card { min-height: 216px; padding: 24px; }
  .home-card-copy { padding-top: 0; }
  .home-card-art { top: 62%; width: 47%; right: 8px; }
  .home-card-copy strong { font-size: 29px; }
  .home-card-copy > span { font-size: 14px; margin-top: 8px; }
}
@media print {
  .topbar, .home-animals, .student-plan > .back, #toast { display: none !important; }
  .student-plan { margin: 0; padding: 0; width: 100%; }
}
/* The approved illustration sits in the existing empty footer space. */
.home-animals { --scene-width: min(100vw, 154.545vh); display: none; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--scene-width) * .22); overflow: hidden; pointer-events: none; }
#app.home-view + .home-animals { display: block; }
/* Ground spans the document width independently of the illustration size.
   Its centre dips under the opaque artwork, preserving the original grass line. */
.home-animals::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(#c5d3ab, #c2d0a9);
  clip-path: polygon(
    0 calc(var(--scene-width) * .124),
    calc(50% - var(--scene-width) * .49) calc(var(--scene-width) * .124),
    calc(50% - var(--scene-width) * .40) calc(var(--scene-width) * .16),
    calc(50% + var(--scene-width) * .40) calc(var(--scene-width) * .16),
    calc(50% + var(--scene-width) * .49) calc(var(--scene-width) * .124),
    100% calc(var(--scene-width) * .124), 100% 100%, 0 100%
  );
}
.home-animals img {
  position: absolute; width: var(--scene-width); height: auto; max-width: none;
  left: 50%; top: calc(var(--scene-width) * -.10); transform: translateX(-50%);
  mask-image: linear-gradient(to right, transparent, #000 2%, #000 98%, transparent);
}
.home-animals::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--scene-width) * .045); background: linear-gradient(transparent, #c2d0a9); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.home-links{flex-wrap:wrap;gap:16px 30px}
