/* ---------- 一课一练 (own screens; mockups design/mockups/green/*.jpg, decisions D17–D21) ----------
   One meaning per colour: blue = press (one solid blue button at a time), yellow = picked, pencil = hint,
   red = marks and corrections only. Text ≥ 21px and tap targets ≥ 64px on the iPad (1rem = 16px at 1180×820). */
:root { --pencil: #3F4B5C; --struck: #5E6E7C; --done: #E3E9EF; --sheet-edge: #E2E9DA; --yel-line: #9A7300;
  --py-font: "PingFang SC", "Helvetica Neue", "Noto Sans", Arial, sans-serif; }
.py { font-family: var(--py-font); }
.screen.app { padding: 0; }
.bar { display: flex; align-items: center; gap: 1.2rem; height: 5.6rem; padding: 0 1.5rem; flex: none; }
.bar .grow { flex: 1; }
.bar .who { font-family: var(--kai); font-weight: 700; font-size: 1.625rem; white-space: nowrap; }
.bar h1 { font-size: 1.95rem; margin: 0; white-space: nowrap; }
.bar .rv { font-size: 1.56rem; font-weight: 700; }
.btn-line { min-height: 4rem; font-size: 1.375rem; }
.btn-line .spk { width: 1.6rem; height: 1.6rem; }
.btn-blue { min-height: 4.375rem; font-size: 1.5rem; min-width: 12.5rem; }
.parts { display: flex; align-items: center; gap: 0.8rem; font-size: 1.375rem; white-space: nowrap; }
.parts .p { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink2); font-weight: 600; }
.parts .p i { width: 2rem; height: 2rem; border-radius: 50%; border: 0.15rem solid var(--ink2); display: inline-grid; place-items: center; font-style: normal; font-size: 1.3rem; }
.parts .p.cur, .parts .p.done { color: var(--ink); font-weight: 700; }
.parts .p.cur i, .parts .p.done i { background: var(--ink); border-color: var(--ink); color: #fff; }
.parts .p.done i::after { content: ""; width: 0.45rem; height: 0.85rem; border: solid #fff; border-width: 0 0.18rem 0.18rem 0; transform: translateY(-0.1rem) rotate(45deg); }
.parts .p.done i { font-size: 0; }
.parts .dots { width: 2.4rem; border-top: 0.15rem dotted var(--ink2); }

/* the worksheet lying on the desk */
.ws { flex: 1; min-height: 0; margin: 0 2.5rem 0.9rem; background: var(--paper); border: 0.094rem solid var(--edge); border-radius: 0.25rem;
  box-shadow: 0.25rem 0.375rem 0 var(--desk-shadow); display: flex; flex-direction: column; position: relative; }
.ws-head { display: flex; align-items: baseline; gap: 1rem; margin: 0 2.25rem; padding: 1rem 0 0.7rem; border-bottom: 0.125rem solid var(--sheet-edge); }
.ws-head h2 { font-family: var(--kai); font-weight: 700; color: var(--green); font-size: 1.56rem; margin: 0; white-space: nowrap; }
.ws-head .from { margin-left: auto; color: var(--ink2); font-size: 1.31rem; }
.ws-row { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 2.25rem 0; }
.tab { position: relative; background: var(--tab); font-weight: 700; font-size: 1.375rem; padding: 0.55rem 1.3rem 0.6rem 1.5rem; transform: rotate(-0.4deg); white-space: nowrap; }
.tab::before { content: ""; position: absolute; left: -0.25rem; top: -0.8rem; width: 0.6rem; height: 2.5rem; border: 0.14rem solid #6B7A86; border-radius: 0.4rem; }
.qdots { margin-left: auto; display: flex; align-items: center; gap: 0.55rem; }
.qdots .lab { color: var(--ink2); font-size: 1.31rem; font-weight: 600; margin-right: 0.6rem; white-space: nowrap; }
.qdots b { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 0.11rem solid var(--edge); background: #fff; display: inline-grid; place-items: center; flex: none; }
.qdots b.done { background: var(--ink); border-color: var(--ink); }
.qdots b.done::after { content: ""; width: 0.3rem; height: 0.55rem; border: solid #fff; border-width: 0 0.14rem 0.14rem 0; transform: translateY(-0.06rem) rotate(45deg); }
.qdots b.miss { background: var(--done); border-color: var(--edge); }
.qdots b.cur { border: 0.22rem solid var(--ink); width: 1.5rem; height: 1.5rem; }
.rule1 { text-align: right; color: var(--ink2); font-size: 1.31rem; padding: 0.4rem 2.25rem 0; min-height: 1.9rem; }
.ws-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 2.25rem; display: flex; flex-direction: column; }
.ws-foot { display: flex; align-items: center; gap: 1.5rem; padding: 0.6rem 2.25rem 1.1rem; min-height: 5.9rem; flex: none; }
.ws-foot .say { flex: 1; min-width: 0; }
.ws-foot .say p { margin: 0; }
.note { color: var(--ink2); font-size: 1.375rem; }
.pencil { font-family: var(--kai); font-weight: 700; color: var(--pencil); font-size: 1.69rem; line-height: 1.35; }
.inkline { font-family: var(--kai); font-weight: 700; color: var(--ink); font-size: 1.81rem; line-height: 1.35; }
.inkline .py, .pencil .py { font-weight: 600; font-size: 0.92em; }
.redtick { display: inline-block; width: 1.1rem; height: 2rem; border: solid var(--red); border-width: 0 0.28rem 0.28rem 0; transform: rotate(40deg) translateY(-0.3rem); margin: 0 1.2rem 0 0.4rem; vertical-align: middle; }

/* ① 写拼音: characters with their syllable cards, then the five tone keys */
.pyq { display: flex; flex-direction: column; align-items: center; padding-top: 1.2rem; }
.syls { display: flex; gap: 2.25rem; justify-content: center; }
.syl { display: flex; flex-direction: column; align-items: center; width: 12.5rem; }
.syl .ch { font-family: var(--kai); font-size: 7.5rem; line-height: 1.05; position: relative; }
.syl .ch.cue::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -0.1rem; height: 0.6rem; border-bottom: 0.19rem solid var(--pencil); border-radius: 0 0 50% 50%; }
.card { width: 12.5rem; height: 6rem; margin-top: 0.9rem; border-radius: 0.5rem; display: grid; place-items: center; font-family: var(--py-font); font-size: 2.875rem;
  background: #fff; border: 0.125rem dashed var(--ink); padding: 0; color: var(--ink); position: relative; }
.card.active { border: 0.24rem solid var(--ink); }
.card.picked { background: var(--yellow); border: 0; box-shadow: inset 0 -0.19rem 0 var(--yel-line); }
.card.picked.active { border: 0.24rem solid var(--ink); }
.card.active::after { content: ""; position: absolute; left: 50%; bottom: -1.5rem; transform: translateX(-50%); border: 0.9rem solid transparent; border-top: 1rem solid var(--ink); border-bottom: 0; }
.card.done { background: none; border: 0; border-bottom: 0.125rem solid var(--ink); border-radius: 0; cursor: default; }
.card .was { position: relative; }
.card .was::after { content: ""; position: absolute; left: -0.5rem; right: -0.5rem; top: 52%; border-top: 0.21rem solid var(--red); transform: rotate(-2deg); }
.card .fix { position: absolute; top: 100%; left: 0; right: 0; text-align: center; color: var(--red-text); font-weight: 700; font-size: 2.5rem; margin-top: 0.4rem; }
.ctx { color: var(--ink2); font-size: 1.5rem; margin-top: 0.8rem; font-family: var(--kai); }
.keys { display: flex; gap: 1.25rem; justify-content: center; margin-top: 4.2rem; }
.key { width: 9.375rem; height: 7rem; background: #fff; border: 0.15rem solid var(--ink); border-radius: 0.56rem; box-shadow: 0 0.31rem 0 var(--desk-shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; position: relative; padding: 0; }
.key svg { width: 3.4rem; height: 2.2rem; }
.key span { font-size: 1.375rem; font-weight: 600; }
.key:active { transform: translateY(0.15rem); box-shadow: 0 0.12rem 0 var(--desk-shadow); }
.key.on::after, .chip.on::after { content: ""; position: absolute; left: 0.2rem; right: 0.2rem; bottom: 0.2rem; height: 0.44rem; border-radius: 0.2rem; background: var(--yellow); box-shadow: 0 0.1rem 0 var(--yel-line); }
.key.struck, .chip.struck { background: var(--done); border-color: var(--edge); box-shadow: none; color: var(--struck); }
.key.struck span { text-decoration: line-through; text-decoration-thickness: 0.15rem; }
.key.struck svg * { stroke: var(--struck); fill-opacity: 1; }
.key.struck svg circle { fill: var(--struck); }

/* ② 填词语: the sentence with its blanks, the word tray */
.sent { font-family: var(--kai); font-size: 2.375rem; line-height: 5rem; padding: 1.6rem 0 0; letter-spacing: 0.02em; }
.blank { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; min-width: 9.4rem; height: 3.6rem; line-height: 1; margin: 0 0.2rem; text-align: center; border-radius: 0.4rem;
  background: #fff; border: 0.125rem dashed var(--ink); padding: 0 0.3rem; font: inherit; font-weight: 700; color: var(--ink); position: relative; }
.blank.active { border: 0.22rem solid var(--ink); }
.blank.picked { background: var(--yellow); border: 0; box-shadow: inset 0 -0.19rem 0 var(--yel-line); }
.blank.picked.active { border: 0.22rem solid var(--ink); }
.blank.set { background: none; border: 0; border-bottom: 0.125rem solid var(--ink); border-radius: 0; cursor: default; }
.blank.fixed { background: none; border: 0; border-bottom: 0.125rem solid var(--ink); border-radius: 0; cursor: default; font-weight: 400; }
.blank.fixed .was { position: relative; }
.blank.fixed .was::after { content: ""; position: absolute; left: -0.3rem; right: -0.3rem; top: 50%; border-top: 0.21rem solid var(--red); transform: rotate(-2deg); }
.blank.fixed .fix { position: absolute; left: 0; right: 0; bottom: 100%; color: var(--red-text); font-weight: 700; font-size: 0.9em; line-height: 1.1; }
.cue { text-decoration: underline; text-decoration-color: var(--pencil); text-decoration-thickness: 0.19rem; text-underline-offset: 0.35em; }
.tray { margin-top: auto; background: #fff; border: 0.125rem solid var(--sheet-edge); border-radius: 0.6rem; padding: 0.7rem 1.2rem 1.1rem; }
.tray .lab { color: var(--ink2); font-size: 1.31rem; font-weight: 600; margin-bottom: 0.5rem; }
.chips { display: grid; grid-template-columns: repeat(6, 9.375rem); gap: 0.9rem 1rem; justify-content: center; }
.chip { height: 4rem; background: #fff; border: 0.15rem solid var(--ink); border-radius: 0.56rem; box-shadow: 0 0.31rem 0 var(--desk-shadow); font-family: var(--kai);
  font-weight: 700; font-size: 1.875rem; position: relative; padding: 0; white-space: nowrap; }
.chip.long { font-size: 1.625rem; letter-spacing: -0.03em; }
.chip.struck { text-decoration: line-through; text-decoration-thickness: 0.15rem; }
.chips.four { grid-template-columns: repeat(4, 14.375rem); gap: 1.6rem; }
.chips.four .chip { height: 5.25rem; font-size: 2.125rem; }

/* end of a sheet */
.done-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem 0 0; }
.done-wrap h3 { font-family: var(--kai); font-size: 2.25rem; margin: 0 0 2rem; grid-column: 1 / -1; }
.scorerow { display: flex; align-items: baseline; gap: 1rem; font-size: 1.625rem; font-weight: 600; margin-bottom: 1.4rem; }
.scorerow .lab { width: 9rem; }
.scorerow b { font-family: var(--kai); color: var(--red-text); font-size: 2.25rem; width: 3rem; text-align: center; }
.scorerow small { color: var(--ink2); font-size: 1.5rem; font-weight: 400; white-space: nowrap; }
.scorerow.total { border-top: 0.125rem solid var(--sheet-edge); padding-top: 1.4rem; width: 24rem; }
.scorerow.total b { font-size: 3.4rem; border: 0.21rem solid var(--red); border-radius: 50% 46% 52% 48%; width: 6rem; height: 5rem; display: inline-grid; place-items: center; transform: rotate(-4deg); }
.back-list h4 { font-size: 1.56rem; margin: 0 0 1rem; }
.back-list p { margin: 0 0 0.9rem; display: flex; align-items: baseline; gap: 1rem; }
.back-list .tag { color: var(--ink2); font-size: 1.375rem; font-weight: 600; width: 7rem; flex: none; }
.back-list .w { font-family: var(--kai); font-weight: 700; font-size: 2rem; }
.back-list .py { color: var(--ink2); font-size: 1.375rem; }

/* home */
.home .grow { flex: 1; }
.rvcard { display: flex; align-items: center; gap: 2rem; margin: 0 2.75rem 0; background: #fff; border: 0.094rem solid var(--edge); border-radius: 0.75rem; padding: 1.2rem 1.9rem; flex: none; }
.rvcard .stack { position: relative; width: 8.6rem; height: 6.4rem; flex: none; }
.rvcard .stack i { position: absolute; width: 7.5rem; height: 5rem; border-radius: 0.375rem; background: var(--yellow); border: 0.11rem solid var(--yel-line); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 2.5rem; }
.rvcard .stack.empty i { background: var(--done); border-color: var(--edge); }
.rvcard h2 { font-size: 1.81rem; margin: 0 0 0.4rem; }
.rvcard p { margin: 0; color: var(--ink2); font-size: 1.375rem; }
.rvcard .grow { flex: 1; }
.homelist { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1.4rem 2.75rem 1.5rem; }
.homelist .lab { color: var(--ink2); font-size: 1.375rem; font-weight: 600; margin: 0 0 0.8rem; }
.lesson-row { display: grid; grid-template-columns: 7.25rem 1fr 1fr; gap: 1.9rem; align-items: center; margin-bottom: 1.6rem; }
.lesson-row .no { font-family: var(--kai); font-weight: 700; color: var(--green); font-size: 1.81rem; }
.scard { height: 7rem; background: var(--paper); border: 0.125rem solid var(--ink); border-radius: 0.5rem; box-shadow: 0.19rem 0.31rem 0 var(--desk-shadow); text-align: left;
  padding: 0 1.5rem; display: flex; align-items: center; gap: 1rem; position: relative; min-width: 0; }
.scard.next { border-width: 0.21rem; }
.scard .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.scard .t b { font-family: var(--kai); font-size: 1.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard .t small { color: var(--ink2); font-size: 1.31rem; }
.scard.next .t small { color: var(--ink); font-weight: 700; font-size: 1.375rem; }
.scard .mark { font-family: var(--kai); color: var(--red-text); font-weight: 700; font-size: 2rem; border: 0.19rem solid var(--red); border-radius: 50% 46% 52% 48%; width: 4.6rem; height: 3.6rem;
  display: grid; place-items: center; transform: rotate(-5deg); flex: none; }
.scard .of { color: var(--ink2); font-size: 1.31rem; flex: none; white-space: nowrap; }
.scard .chev { width: 0.9rem; height: 0.9rem; flex: none; }
.homelist .later { color: var(--ink2); font-size: 1.31rem; margin-top: 0.6rem; }
.empty-home { color: var(--ink2); font-size: 1.5rem; padding: 2rem 0; }

/* other sizes */
@media (max-height: 560px) {
  .bar { height: 3.6rem; gap: 0.7rem; padding: 0 0.8rem; }
  .bar .who { font-size: 1.2rem; } .bar h1 { font-size: 1.4rem; } .btn-line { min-height: 2.9rem; font-size: 1.05rem; padding: 0 0.7rem; }
  .parts { font-size: 1.05rem; gap: 0.4rem; } .parts .p i { width: 1.5rem; height: 1.5rem; font-size: 1rem; } .parts .dots { width: 1.2rem; }
  .ws { margin: 0 0.8rem 0.5rem; }
  .ws-head { display: none; }
  .ws-row { padding: 0.6rem 1.2rem 0; } .tab { font-size: 1.05rem; padding: 0.3rem 0.8rem 0.35rem 1rem; } .qdots b { width: 1rem; height: 1rem; } .qdots b.miss { background: var(--done); border-color: var(--edge); }
.qdots b.cur { width: 1.1rem; height: 1.1rem; } .qdots .lab { font-size: 1rem; }
  .rule1 { font-size: 1rem; padding: 0.1rem 1.2rem 0; min-height: 1.2rem; }
  .ws-body { padding: 0 1.2rem; } .ws-foot { padding: 0.3rem 1.2rem 0.5rem; min-height: 3.6rem; gap: 0.8rem; }
  .btn-blue { min-height: 2.9rem; font-size: 1.1rem; min-width: 8rem; }
  .note { font-size: 1rem; } .pencil { font-size: 1.15rem; } .inkline { font-size: 1.2rem; }
  .pyq { padding-top: 0.2rem; } .syls { gap: 1rem; } .syl, .card { width: 7.5rem; } .syl .ch { font-size: 3.4rem; } .card { height: 3.2rem; font-size: 1.7rem; margin-top: 0.3rem; }
  .card.active::after { bottom: -1rem; border-width: 0.55rem; border-top-width: 0.6rem; }
  .card .fix { font-size: 1.5rem; margin-top: 0.1rem; }
  .ctx { font-size: 1.05rem; margin-top: 0.2rem; }
  .keys { margin-top: 2rem; gap: 0.7rem; } .key { width: 6.4rem; height: 3.6rem; gap: 0.1rem; } .key svg { width: 2.2rem; height: 1.3rem; } .key span { font-size: 1rem; }
  .sent { font-size: 1.45rem; line-height: 2.9rem; padding-top: 0.5rem; } .blank { min-width: 6rem; height: 2.3rem; }
  .tray { padding: 0.3rem 0.6rem 0.5rem; margin-top: 0.4rem; } .tray .lab { display: none; }
  .chips { grid-template-columns: repeat(6, 6.6rem); gap: 0.45rem 0.6rem; } .chip { height: 2.9rem; font-size: 1.3rem; } .chip.long { font-size: 1.1rem; }
  .chips.four { grid-template-columns: repeat(4, 9rem); gap: 0.8rem; } .chips.four .chip { height: 3.2rem; font-size: 1.4rem; }
  .rvcard { margin: 0 1rem; padding: 0.5rem 1rem; gap: 1rem; } .rvcard .stack { width: 4.6rem; height: 3.4rem; } .rvcard .stack i { width: 4rem; height: 2.7rem; font-size: 1.4rem; }
  .rvcard h2 { font-size: 1.25rem; } .rvcard p { font-size: 1rem; }
  .homelist { padding: 0.6rem 1rem; } .homelist .lab { font-size: 1rem; }
  .lesson-row { grid-template-columns: 4.4rem 1fr 1fr; gap: 0.8rem; margin-bottom: 0.7rem; } .lesson-row .no { font-size: 1.2rem; }
  .scard { height: 4.2rem; padding: 0 0.8rem; } .scard .t { gap: 0.2rem; } .scard .t b { font-size: 1.2rem; } .scard .t small, .scard.next .t small { font-size: 1rem; }
  .scard .mark { width: 3rem; height: 2.4rem; font-size: 1.3rem; } .scard .of { font-size: 1rem; }
  .done-wrap { padding-top: 0.5rem; gap: 1rem; } .done-wrap h3 { font-size: 1.4rem; margin-bottom: 0.6rem; } .scorerow { font-size: 1.1rem; margin-bottom: 0.5rem; } .scorerow b { font-size: 1.5rem; }
  .scorerow.total { width: auto; min-width: 16rem; padding-top: 0.5rem; } .scorerow.total b { font-size: 2rem; width: 4rem; height: 3rem; } .back-list h4 { font-size: 1.1rem; margin-bottom: 0.4rem; }
  .back-list p { margin-bottom: 0.3rem; } .back-list .tag { font-size: 1rem; width: 5rem; } .back-list .w { font-size: 1.3rem; } .back-list .py { font-size: 1rem; }
}
