:root {
  --deep: #1e4e8c;
  --sky: #4fa3ff;
  --soft: #eff7ff;
  --line: #b8dcff;
  --ink: #153052;
  --sun: #ffd45c;
  --green: #7cc66a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  overflow: hidden;
  width: min(100vw, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 16px;
  background:
    radial-gradient(circle at 88% 9%, rgba(255, 255, 255, 0.25), transparent 18%),
    linear-gradient(180deg, #1f80ec 0%, var(--deep) 100%);
}

.app::before,
.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.app::before {
  display: none;
}

.app::after {
  display: none;
}

.blue-bg-animals {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-animal {
  position: absolute;
  display: block;
  height: auto;
  opacity: 0.58;
  filter: drop-shadow(0 6px 0 rgba(30, 78, 140, 0.13));
}

.bg-whale {
  right: 98px;
  top: 6px;
  width: 82px;
  transform: rotate(8deg);
}

.bg-bird {
  left: -12px;
  top: 108px;
  width: 58px;
  transform: rotate(-9deg);
}

.bg-bunny {
  right: -30px;
  bottom: 12px;
  width: 78px;
  transform: rotate(7deg);
}

.topbar,
.day-tabs,
.lesson,
.bottom-bar {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}

.brand-title {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  column-gap: 8px;
}

.brand-title > span:not(.whale-logo) {
  grid-column: 2;
}

.whale-logo {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 64px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.whale-logo img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.topbar strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.topbar span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.95;
}

.topbar button,
.sentence-label button,
.bottom-bar button {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: var(--deep);
  font-weight: 800;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.14);
}

.teacher-banner {
  display: none;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  margin: 7px 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  color: var(--deep);
  box-shadow: none;
}

.teacher-banner span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 7px;
  color: var(--deep);
  font-size: 11px;
  font-weight: 900;
}

.teacher-banner strong {
  min-width: 0;
  color: #fff;
  font-size: clamp(12px, 2.5vw, 15px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.teacher-banner em {
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.day-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 2px 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 800;
  scroll-snap-align: start;
}

.day-tab.active {
  background: #fff;
  color: var(--deep);
}

.lesson {
  position: relative;
  overflow: hidden;
  border: 5px solid #8bc8ff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.lesson.decor-preview::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(79, 163, 255, 0.34);
  border-radius: 18px;
  pointer-events: none;
  z-index: 0;
}

.worksheet-top,
.worksheet-grid,
.sentence-stage {
  position: relative;
  z-index: 2;
}

.corner-decor {
  position: absolute;
  display: none;
  z-index: 0;
  pointer-events: none;
  opacity: 0.82;
  transform: scale(0.72);
  transform-origin: center;
}

.lesson.decor-preview .corner-decor {
  display: block;
}

.corner-top-left {
  left: 6px;
  top: 4px;
  width: 92px;
  height: 62px;
}

.corner-top-right {
  right: 8px;
  top: 66px;
  width: 76px;
  height: 62px;
}

.corner-bottom-left {
  left: -8px;
  bottom: 8px;
  width: 108px;
  height: 74px;
  transform-origin: left bottom;
}

.corner-bottom-right {
  right: -5px;
  bottom: 8px;
  width: 112px;
  height: 78px;
  transform-origin: right bottom;
}

.corner-decor::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 18px;
  background: rgba(239, 247, 255, 0.78);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.decor-cloud {
  position: absolute;
  z-index: 1;
  left: 4px;
  top: 20px;
  width: 54px;
  height: 22px;
  border-radius: 999px;
  background: #dff3ff;
  box-shadow:
    15px -12px 0 2px #f3fbff,
    30px -3px 0 1px #e9f8ff,
    0 6px 0 rgba(79, 163, 255, 0.13);
}

.decor-star,
.decor-star-small {
  position: absolute;
  z-index: 1;
  width: 26px;
  height: 26px;
  background: #ffd45c;
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
  filter: drop-shadow(0 3px 0 rgba(231, 159, 30, 0.25));
}

.decor-star-small {
  right: 6px;
  top: 4px;
  width: 18px;
  height: 18px;
}

.decor-pencil {
  position: absolute;
  z-index: 1;
  left: 38px;
  top: 38px;
  width: 44px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcb4f 0 72%, #f08b63 72% 86%, #253b5c 86%);
  transform: rotate(-18deg);
  box-shadow: 0 3px 0 rgba(30, 78, 140, 0.14);
}

.decor-pencil-blue {
  left: 50px;
  top: 47px;
  background: linear-gradient(90deg, #4fa3ff 0 72%, #f08b63 72% 86%, #253b5c 86%);
}

.decor-sun {
  position: absolute;
  z-index: 1;
  right: 28px;
  top: 7px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff4a8 0 18%, #ffd45c 19% 68%, #f9ba33 69%);
  box-shadow:
    0 0 0 6px rgba(255, 212, 92, 0.16),
    0 5px 0 rgba(231, 159, 30, 0.18);
}

.decor-note {
  position: absolute;
  z-index: 1;
  color: #4fa3ff;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 2px 0 #fff;
}

.decor-note-one {
  left: 2px;
  top: 28px;
  transform: rotate(-10deg);
}

.decor-note-two {
  right: 0;
  bottom: 0;
  color: #ffd45c;
  transform: rotate(12deg);
}

.decor-grass {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 104px;
  height: 28px;
  border-radius: 80% 80% 0 0;
  background: linear-gradient(180deg, #8bdc71 0%, #42a95a 100%);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.22);
}

.decor-flower {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffd45c;
  box-shadow:
    0 -9px 0 #fff3a7,
    0 9px 0 #fff3a7,
    -9px 0 0 #fff3a7,
    9px 0 0 #fff3a7;
}

.decor-flower-one {
  left: 24px;
  bottom: 28px;
}

.decor-flower-two {
  left: 72px;
  bottom: 22px;
  transform: scale(0.72);
}

.decor-book {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 8px;
  width: 54px;
  height: 36px;
  border-radius: 6px 6px 4px 4px;
  background:
    linear-gradient(90deg, #ff8f8f 0 48%, #fff 48% 52%, #73c3ff 52% 100%);
  box-shadow:
    inset 0 -5px 0 rgba(30, 78, 140, 0.12),
    0 5px 0 rgba(30, 78, 140, 0.14);
}

.corner-bottom-right .decor-star {
  left: 6px;
  top: 4px;
}

.worksheet-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 16px 8px;
}

.brand-badge {
  justify-self: start;
  border-radius: 999px;
  background: var(--sky);
  color: #fff;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(30, 78, 140, 0.2);
}

.title-pill {
  border-radius: 999px;
  background: linear-gradient(180deg, #338be9 0%, #1f6ed6 100%);
  color: #fff;
  padding: 9px 14px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 0 rgba(30, 78, 140, 0.2);
}

.title-pill::before,
.title-pill::after {
  content: "★";
  color: var(--sun);
  margin: 0 8px;
}

.day-no {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--deep);
  font-size: 50px;
  line-height: 1;
  font-weight: 900;
  text-shadow:
    0 2px 0 #fff,
    2px 0 0 #fff,
    -2px 0 0 #fff,
    0 -2px 0 #fff,
    0 5px 0 rgba(79, 163, 255, 0.18);
}

.worksheet-grid {
  position: relative;
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 0;
  padding: 2px 14px 4px;
}

.worksheet-grid::before {
  content: "";
  position: absolute;
  top: 54px;
  left: 36px;
  bottom: 30px;
  width: 6px;
  border-radius: 999px;
  background: var(--sky);
}

.left-column {
  position: relative;
  min-width: 0;
  padding: 6px 8px 0 2px;
  z-index: 2;
}

.rail {
  display: none;
}

.right-column {
  min-width: 0;
  padding: 4px 0 0 4px;
  z-index: 1;
}

.bottom-phrases {
  position: relative;
  grid-column: 1 / -1;
  margin-top: -8px;
  padding: 0 0 0 2px;
}

.rail-bottom {
  display: none;
}

.lesson-head {
  display: block;
  padding: 0 4px 4px;
  text-align: center;
}

.lesson-head span {
  display: inline-block;
  border-radius: 999px;
  background: linear-gradient(180deg, #56aaff 0%, #338be9 100%);
  padding: 5px 18px;
  color: var(--sky);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.lesson-head strong {
  display: block;
  margin-top: 4px;
  color: var(--deep);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
}

.lesson-head strong.long-title {
  min-height: 42px;
  font-size: clamp(26px, 4.2vw, 44px);
  line-height: 1;
}

.sentence-stage {
  margin: 0 14px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f5fbff 0%, #eaf6ff 100%);
  padding: 10px 12px 12px;
}

.sentence-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sentence-label span {
  color: var(--sky);
  font-size: 16px;
  font-weight: 900;
}

.sentence-label button {
  padding: 8px 12px;
  box-shadow: none;
}

#currentSentence {
  min-height: 72px;
  margin: 0;
  color: var(--deep);
  font-size: clamp(28px, 6.4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

#currentSentence .new-part,
.phrase-text .new-part {
  color: var(--sky);
}

#translation {
  margin: 6px 0 0;
  color: #31506f;
  font-size: 19px;
  font-weight: 800;
}

.visual-band {
  padding: 0;
}

.illustration {
  position: relative;
  width: min(104%, 370px);
  aspect-ratio: 1 / 1;
  height: auto;
  margin-left: -24px;
  margin-right: auto;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  filter: drop-shadow(0 14px 14px rgba(30, 78, 140, 0.16));
}

.illustration img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.image-word-label {
  position: absolute;
  z-index: 3;
  min-width: 82px;
  max-width: 122px;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--deep);
  padding: 0;
  text-align: left;
  box-shadow: none;
  text-shadow:
    0 2px 0 #fff,
    2px 0 0 #fff,
    -2px 0 0 #fff,
    0 -2px 0 #fff,
    0 6px 12px rgba(30, 78, 140, 0.24);
}

.image-word-label strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.image-word-label span {
  display: block;
  margin-top: 3px;
  color: var(--deep);
  font-size: 12px;
  line-height: 1.05;
  font-weight: 800;
  white-space: nowrap;
}

.reader-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 0;
}

.phrase-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid #d8eaff;
  border-radius: 0;
  background: transparent;
  padding: 4px 6px 7px 0;
}

.phrase-row.active {
  background: #e4f3ff;
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(79, 163, 255, 0.2) inset;
}

.left-column .phrase-row.active {
  width: fit-content;
  min-width: 100%;
  max-width: none;
  padding-right: 14px;
}

.left-column .phrase-row.active .phrase-copy {
  width: max-content;
}

.bottom-list .phrase-row.active {
  width: 100%;
}

.phrase-index {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f8df0 0%, #1f72df 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.phrase-copy {
  min-width: 0;
  overflow: visible;
  text-align: left;
}

.phrase-text {
  display: block;
  color: var(--deep);
  font-size: clamp(19px, 4.6vw, 32px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
}

.bottom-list {
  padding-left: 0;
}

.bottom-list .phrase-row {
  grid-template-columns: 42px 1fr;
  min-height: 64px;
  padding-top: 2px;
  padding-bottom: 4px;
}

.bottom-list .phrase-text {
  font-size: clamp(20px, 4.8vw, 32px);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.08;
}

.sentence-stage h1.long-current {
  white-space: normal;
  overflow-wrap: anywhere;
}

.bottom-list .phrase-cn {
  font-size: 17px;
}

.phrase-cn {
  display: block;
  margin-top: 5px;
  color: #31506f;
  font-size: 15px;
  font-weight: 700;
}

.sentence-mode .worksheet-grid {
  display: block;
  padding: 4px 16px 8px;
}

.sentence-mode .worksheet-grid::before {
  display: none;
}

.sentence-mode .left-column {
  padding: 8px 0 0;
}

.sentence-mode .right-column,
.sentence-mode .bottom-phrases {
  display: none;
}

.sentence-mode .reader-list {
  gap: 8px;
}

.sentence-mode .phrase-row {
  grid-template-columns: 34px minmax(0, 1fr) 152px;
  gap: 12px;
  min-height: 112px;
  border: 2px solid #d8ecff;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 250, 255, 0.95) 100%),
    radial-gradient(circle at 92% 18%, rgba(255, 220, 99, 0.22), transparent 42%);
  padding: 9px 10px 9px 8px;
  box-shadow:
    0 5px 0 rgba(61, 140, 224, 0.12),
    inset 0 0 0 2px rgba(255, 255, 255, 0.76);
}

.sentence-mode .phrase-row.active {
  border-color: #71b9ff;
  background: #e7f4ff;
}

.sentence-mode .phrase-index {
  width: 31px;
  height: 31px;
  font-size: 15px;
}

.sentence-mode .phrase-text {
  white-space: normal;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.08;
}

.sentence-mode .phrase-cn {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 900;
}

.sentence-thumb {
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 152px;
  height: 94px;
  align-self: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff9e9 0%, #eef8ff 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.82);
}

.sentence-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 8px 9px rgba(30, 78, 140, 0.17));
}

.sentence-mode .bottom-phrases {
  margin-top: 8px;
}

.sentence-mode .bottom-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sentence-mode .bottom-list:empty {
  display: none;
}

.sentence-mode .dialogue-row {
  min-height: 58px;
  border-style: dashed;
}

.sentence-mode .illustration {
  width: min(100%, 330px);
  margin-left: -8px;
}

.sentence-mode #currentSentence {
  white-space: normal;
  overflow-wrap: anywhere;
}

.word-cards {
  display: none;
}

.word-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 2px dashed #9ed0ff;
  border-radius: 17px;
  background: #fff;
  padding: 6px 10px 6px 6px;
}

.word-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 3px solid #8bd0ff;
  border-radius: 16px;
  background: #eff7ff;
  font-size: 28px;
  font-weight: 900;
}

.word-main {
  display: block;
  color: var(--deep);
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
}

.word-cn {
  display: block;
  margin-top: 4px;
  color: #31506f;
  font-size: 15px;
  font-weight: 700;
}

.star {
  color: var(--sun);
  font-size: 24px;
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
  color: #fff;
}

.bottom-bar button {
  background: var(--deep);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22) inset;
}

.bottom-bar span {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.92;
}

@media (max-width: 390px) {
  .topbar {
    align-items: center;
  }

  .topbar strong {
    font-size: 18px;
  }

  .topbar button {
    padding: 9px 10px;
    font-size: 14px;
  }

  #translation {
    font-size: 17px;
  }

  .worksheet-top {
    padding-inline: 10px;
  }

  .title-pill {
    padding-inline: 10px;
    font-size: 15px;
  }

  .day-no {
    font-size: 40px;
  }

  .worksheet-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    column-gap: 12px;
    padding-inline: 8px;
  }

  .worksheet-grid::before {
    left: 25px;
    width: 5px;
  }

  .phrase-row {
    grid-template-columns: 34px 1fr;
    gap: 6px;
    min-height: 68px;
  }

  .bottom-phrases {
    margin-top: -2px;
  }

  .phrase-index {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .phrase-text {
    font-size: clamp(13px, 6.8vw, 22px);
  }

  .bottom-list .phrase-text {
    font-size: clamp(14px, 6.8vw, 22px);
    white-space: normal;
    line-height: 1.08;
  }

  .bottom-list .phrase-row {
    min-height: 58px;
  }

  .illustration {
    width: min(106%, 235px);
    height: auto;
    margin-left: -22px;
    margin-right: auto;
  }

  .image-word-label {
    min-width: 58px;
    max-width: 82px;
  }

  .image-word-label strong {
    font-size: 15px;
  }

  .image-word-label span {
    font-size: 10px;
  }
}

@media (max-width: 600px) {
  .app {
    padding: max(7px, env(safe-area-inset-top)) 7px 8px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 7px;
    row-gap: 2px;
  }

  .brand-title {
    display: contents;
    min-width: 0;
  }

  .whale-logo {
    grid-column: 1;
    grid-row: 1;
    width: 66px;
    height: 54px;
    border-radius: 0;
  }

  .whale-logo img {
    width: 66px;
    height: 66px;
  }

  .topbar strong {
    grid-column: 2;
    grid-row: 1;
    font-size: clamp(18px, 5.1vw, 22px);
    line-height: 1;
    white-space: nowrap;
  }

  .brand-title > span:not(.whale-logo) {
    grid-column: 2 / -1;
    grid-row: 2;
    margin: -4px 0 3px;
    font-size: clamp(11px, 3vw, 13px);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .brand-title > span:not(.whale-logo) {
    grid-column: 2 / -1;
  }

  .topbar button,
  .bottom-bar button {
    grid-column: 3;
    grid-row: 1;
    padding: 8px 11px;
    font-size: 14px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.14);
  }

  .teacher-banner {
    display: none;
    grid-template-columns: auto minmax(0, auto) auto;
    margin: 5px 0 1px;
    padding: 3px 7px;
    column-gap: 5px;
    row-gap: 2px;
  }

  .teacher-banner span {
    padding: 2px 6px;
    font-size: 10px;
  }

  .teacher-banner strong {
    font-size: 12px;
  }

  .teacher-banner em {
    font-size: 9px;
  }

  .day-tabs {
    gap: 6px;
    margin: 5px 0 7px;
    padding: 1px 2px 5px;
  }

  .day-tab {
    min-width: 72px;
    min-height: 32px;
    border-width: 1px;
    font-size: 12px;
  }

  .lesson {
    border-width: 4px;
    border-radius: 18px;
  }

  .worksheet-top {
    min-height: 44px;
    padding: 7px 9px 3px;
  }

  .brand-badge {
    padding: 4px 7px;
    font-size: 9px;
    white-space: nowrap;
  }

  .title-pill {
    min-width: 0;
    width: auto;
    padding: 8px 12px;
    font-size: clamp(14px, 4vw, 17px);
    text-align: center;
    white-space: nowrap;
  }

  .title-pill::before,
  .title-pill::after {
    margin: 0 4px;
  }

  .day-no {
    font-size: 38px;
    right: 9px;
  }

  .worksheet-grid {
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
    column-gap: 14px;
    padding: 0 7px 0;
  }

  .worksheet-grid::before {
    top: 43px;
    left: 24px;
    bottom: 24px;
    width: 5px;
  }

  .left-column {
    padding: 3px 4px 0 0;
  }

  .right-column {
    padding: 1px 0 0 2px;
  }

  .lesson-head {
    padding-bottom: 3px;
  }

  .lesson-head span {
    padding: 3px 9px;
    font-size: 11px;
  }

  .lesson-head strong {
    margin-top: 3px;
    font-size: clamp(22px, 6.2vw, 31px);
  }

  .lesson-head strong.long-title {
    min-height: 30px;
    font-size: clamp(17px, 5.2vw, 24px);
  }

  .illustration {
    width: min(106%, 238px);
    height: auto;
    margin-left: -24px;
    margin-right: auto;
  }

  .image-word-label {
    min-width: 58px;
    max-width: 84px;
  }

  .image-word-label strong {
    font-size: 15px;
  }

  .image-word-label span {
    font-size: 9px;
  }

  .reader-list {
    gap: 2px;
  }

  .phrase-row {
    grid-template-columns: 32px 1fr;
    gap: 5px;
    min-height: 58px;
    padding: 2px 3px 3px 0;
  }

  .phrase-index {
    width: 31px;
    height: 31px;
    font-size: 15px;
  }

  .phrase-text {
    font-size: clamp(13px, 6.8vw, 22px);
    line-height: 1;
  }

  .phrase-cn {
    margin-top: 3px;
    font-size: 12px;
  }

  .bottom-phrases {
    margin-top: -1px;
  }

  .bottom-list .phrase-row {
    grid-template-columns: 32px 1fr;
    min-height: 58px;
    padding-top: 1px;
    padding-bottom: 2px;
  }

  .bottom-list .phrase-text {
    font-size: clamp(14px, 6.8vw, 22px);
    white-space: normal;
    line-height: 1.08;
  }

  .bottom-list .phrase-cn {
    font-size: 12px;
  }

  .sentence-mode .worksheet-grid {
    display: block;
    padding-inline: 9px;
  }

  .sentence-mode .reader-list {
    gap: 5px;
  }

  .sentence-mode .phrase-row {
    grid-template-columns: 27px minmax(0, 1fr) 98px;
    gap: 7px;
    min-height: 88px;
    padding: 7px 7px 7px 5px;
    border-radius: 11px;
  }

  .sentence-mode .phrase-index {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .sentence-mode .phrase-text {
    font-size: clamp(16px, 5.2vw, 21px);
    line-height: 1.08;
  }

  .sentence-mode .phrase-cn {
    margin-top: 3px;
    font-size: 12px;
  }

  .sentence-thumb {
    width: 98px;
    height: 72px;
    border-radius: 10px;
  }

  .sentence-thumb img {
    width: 100%;
    height: 100%;
  }

  .sentence-stage {
    margin: 4px 8px 8px;
    border-radius: 14px;
    padding: 7px 9px 8px;
  }

  .sentence-label {
    margin-bottom: 5px;
  }

  .sentence-label span {
    font-size: 13px;
  }

  .sentence-label button {
    padding: 5px 9px;
    font-size: 12px;
  }

  #currentSentence {
    min-height: 52px;
    font-size: clamp(15px, 7.4vw, 26px);
    line-height: 1.03;
  }

  #translation {
    margin-top: 3px;
    font-size: 14px;
  }

  .bottom-bar {
    padding-top: 6px;
  }

  .bottom-bar span {
    font-size: 11px;
  }
}

@media (max-width: 600px) and (max-height: 760px) {
  .brand-title > span:not(.whale-logo) {
    display: block;
    font-size: 10px;
    line-height: 1.15;
  }

  .teacher-banner {
    display: none;
    margin-top: 4px;
    padding: 2px 6px;
  }

  .teacher-banner span {
    padding: 2px 5px;
    font-size: 9px;
  }

  .teacher-banner strong {
    font-size: 11px;
  }

  .teacher-banner em {
    grid-column: 2 / 4;
    font-size: 8px;
    opacity: 0.86;
  }

  .day-tabs {
    margin-top: 5px;
  }

  .worksheet-top {
    min-height: 40px;
    padding-top: 6px;
  }

  .title-pill {
    font-size: 14px;
  }

  .phrase-row,
  .bottom-list .phrase-row {
    min-height: 45px;
  }

  .illustration {
    width: min(104%, 210px);
    height: auto;
    margin-left: -22px;
    margin-right: auto;
  }

  .sentence-stage {
    margin-bottom: 6px;
  }
}

@media (max-width: 360px) {
  .app {
    padding-inline: 5px;
  }

  .topbar button {
    padding-inline: 8px;
    font-size: 14px;
  }

  .brand-title {
    grid-template-columns: 58px 1fr;
  }

  .whale-logo {
    width: 58px;
    height: 48px;
  }

  .whale-logo img {
    width: 58px;
    height: 58px;
  }

  .topbar strong {
    font-size: 15px;
  }

  .day-tab {
    min-width: 66px;
    min-height: 30px;
    font-size: 11px;
  }

  .worksheet-grid {
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
    column-gap: 10px;
    padding-inline: 5px;
  }

  .worksheet-grid::before {
    left: 21px;
  }

  .phrase-row,
  .bottom-list .phrase-row {
    grid-template-columns: 29px 1fr;
    min-height: 44px;
  }

  .phrase-index {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .phrase-text {
    font-size: clamp(10px, 6.3vw, 18px);
  }

  .bottom-list .phrase-text {
    font-size: clamp(12px, 6.3vw, 18px);
    white-space: normal;
    line-height: 1.08;
  }

  .illustration {
    width: min(104%, 210px);
    height: auto;
    margin-left: -22px;
    margin-right: auto;
  }

  .sentence-stage {
    margin-inline: 6px;
  }
}

@media (min-width: 430px) and (max-width: 600px) {
  .worksheet-grid {
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
    column-gap: 16px;
  }

  .illustration {
    width: min(106%, 265px);
    height: auto;
    margin-left: -26px;
    margin-right: auto;
  }

  .phrase-row,
  .bottom-list .phrase-row {
    min-height: 54px;
  }

  .phrase-text {
    font-size: clamp(16px, 6.2vw, 24px);
  }

  .bottom-list .phrase-text {
    font-size: clamp(16px, 6.2vw, 24px);
    white-space: normal;
    line-height: 1.08;
  }
}

@media (max-width: 600px) and (min-height: 900px) {
  .app {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .teacher-banner {
    margin-top: 7px;
    margin-bottom: 4px;
  }

  .day-tabs {
    margin-bottom: 10px;
  }

  .worksheet-top {
    min-height: 54px;
  }

  .illustration {
    width: min(106%, 275px);
    height: auto;
    margin-left: -26px;
    margin-right: auto;
  }

  .phrase-row,
  .bottom-list .phrase-row {
    min-height: 56px;
  }

  .sentence-stage {
    margin-top: 8px;
  }
}
