:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #d8dee8;
  --paper: #ffffff;
  --canvas: #eef3f7;
  --green: #0f9f6e;
  --blue: #2563eb;
  --red: #d94848;
  --amber: #b7791f;
  --violet: #7257c9;
  --shadow: 0 16px 45px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #172033;
  color: white;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2c94c;
  color: #172033;
  font-weight: 800;
  font-size: 22px;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 2px 0 0;
  color: #b9c3d4;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  border: 1px solid transparent;
  background: transparent;
  color: #d9e2ef;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
}

.nav button.active {
  background: #27344d;
  border-color: #40506f;
  color: white;
}

.status-panel {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #33425f;
  border-radius: 8px;
}

.mode-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #33425f;
  border-radius: 8px;
  background: #202b40;
}

.mode-note strong {
  font-size: 14px;
}

.mode-note span {
  color: #b9c3d4;
  font-size: 13px;
  line-height: 1.6;
}

.status-panel small {
  display: block;
  color: #b9c3d4;
  margin-top: 2px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7280;
}

.status-dot.ok {
  background: var(--green);
}

.workspace {
  min-width: 0;
  width: 100%;
  padding: 28px;
}

.screen {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.screen-header h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.parent-layout,
.upload-layout,
.training-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.parent-layout {
  grid-template-columns: 340px minmax(0, 1fr) 360px;
  align-items: start;
}

.training-layout {
  grid-template-columns: 1fr 1fr 1fr;
}

.graph-grid {
  display: grid;
  grid-template-columns: 330px 1fr 1fr;
  gap: 18px;
}

.upload-panel,
.result-panel,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.upload-panel h3,
.result-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.dropzone {
  height: 420px;
  border: 1px dashed #9aa7bb;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dropzone input {
  display: none;
}

.dropzone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.drop-empty {
  text-align: center;
  padding: 24px;
}

.drop-empty strong,
.drop-empty span {
  display: block;
}

.drop-empty span,
.microcopy,
.node-desc,
.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  margin-top: 14px;
  color: white;
  background: var(--blue);
}

.primary-button.compact {
  width: auto;
  min-width: 120px;
}

.secondary-button {
  background: #e8f1ff;
  color: #174ea6;
}

.ghost-button {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 420px;
  text-align: center;
}

.empty-state.compact {
  min-height: 300px;
}

.empty-state.wide {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.7;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.analysis-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.analysis-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.analysis-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.summary-text {
  line-height: 1.7;
}

.question-list,
.node-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.question-row,
.node-list button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  text-align: left;
}

.question-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.question-row.active,
.node-list button.active,
.choice-grid button.active {
  border-color: var(--blue);
  background: #eff6ff;
}

.q-main strong,
.q-main small,
.node-list span,
.node-list small {
  display: block;
}

.q-main small,
.node-list small {
  color: var(--muted);
  margin-top: 4px;
}

.badge,
.priority {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.badge.wrong {
  color: #8f1d1d;
  background: #fde8e8;
}

.badge.blank {
  color: #7a4a00;
  background: #fff3d6;
}

.badge.uncertain {
  color: #4b5563;
  background: #eef0f3;
}

.priority {
  background: #eef2ff;
  color: #4338ca;
}

.impact-list {
  display: grid;
  gap: 12px;
}

.impact-row {
  display: grid;
  grid-template-columns: 84px 1fr 44px;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--green);
}

.bar.danger i {
  background: var(--red);
}

.question-text {
  font-size: 18px;
  line-height: 1.8;
  margin: 0 0 16px;
}

.meta-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  margin: 0;
}

.focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.focus-list span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef6f1;
  color: #0f7a54;
  font-size: 13px;
}

.teacher-message {
  margin-top: 16px;
  padding: 14px;
  background: #f8fafc;
  border-left: 3px solid var(--blue);
  line-height: 1.8;
}

.chat-box {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  margin-top: 16px;
  padding-right: 4px;
}

.chat-turn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.chat-turn.user {
  background: #eff6ff;
}

.chat-turn.peer {
  background: #fff8e6;
  border-color: #f1d28a;
}

.chat-turn span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.chat-turn p {
  margin: 0;
  line-height: 1.7;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.step-list {
  padding-left: 20px;
  line-height: 2;
}

.step-list li.done {
  color: var(--green);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.choice-grid button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 800;
  font-size: 20px;
}

.answer-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.feedback {
  padding: 12px;
  border-radius: 8px;
  background: #fff3d6;
  color: var(--amber);
}

.feedback.ok {
  background: #e7f7ef;
  color: var(--green);
}

.full {
  width: 100%;
}

.plan-panel {
  display: grid;
  gap: 14px;
}

.plan-card {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.plan-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-meta span {
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 13px;
  font-weight: 700;
}

.cluster-list {
  display: grid;
  gap: 10px;
}

.cluster-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.cluster-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.child-shell {
  grid-template-columns: 1fr;
  background:
    linear-gradient(180deg, #fffaf0 0%, #f4fbff 48%, #eef8f1 100%);
}

.child-shell .workspace {
  min-height: 100vh;
  padding: 20px;
}

.child-screen {
  width: 100%;
  max-width: 1180px;
}

.child-empty {
  min-height: calc(100vh - 40px);
  gap: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.child-empty .ghost-button {
  justify-self: center;
  min-width: 180px;
}

.child-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  width: 100%;
  min-height: calc(100vh - 40px);
}

.child-stage {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.child-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.child-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-mark,
.teacher-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17324d;
  background: #ffd45a;
  font-size: 22px;
  font-weight: 900;
}

.child-brand strong,
.child-brand small {
  display: block;
}

.child-brand strong {
  font-size: 20px;
}

.child-brand small {
  margin-top: 2px;
  color: #5d6a78;
  font-size: 14px;
  font-weight: 700;
}

.parent-exit {
  min-width: 72px;
  min-height: 48px;
  border: 1px solid #bfd2df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #304256;
  font-weight: 800;
}

.lesson-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
  gap: 8px;
}

.lesson-progress span {
  height: 10px;
  border-radius: 999px;
  background: #d8e1e8;
}

.lesson-progress span.done {
  background: #3aa66d;
}

.lesson-progress span.active {
  background: #1e7bd7;
}

.teacher-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid #c7d7e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(39, 71, 91, 0.08);
}

.teacher-card p {
  margin: 0;
  color: #23364a;
  font-size: 20px;
  line-height: 1.65;
  font-weight: 800;
}

.lesson-voice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d4e0d9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.voice-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voice-toggle button {
  min-height: 42px;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  color: #17324d;
  background: #fbfdff;
  font-weight: 900;
}

.voice-toggle button.active {
  border-color: #2f7bff;
  background: #edf4ff;
}

.lesson-pitch-control {
  display: grid;
  gap: 4px;
  color: #3f4f5e;
  font-size: 13px;
  font-weight: 900;
}

.lesson-audio-status {
  justify-self: end;
  max-width: 240px;
  overflow-wrap: anywhere;
  color: #4b6478;
  font-size: 13px;
  font-weight: 900;
}

.lesson-asr-panel {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  background: rgba(245, 250, 255, 0.86);
}

.listen-toggle {
  min-height: 48px;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  color: #17324d;
  background: #fff;
  font-size: 16px;
  font-weight: 900;
}

.listen-toggle.active {
  border-color: #1e7bd7;
  color: white;
  background: #1e7bd7;
}

.asr-live-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asr-live-text strong {
  color: #24506f;
  font-size: 13px;
}

.asr-live-text span {
  overflow-wrap: anywhere;
  color: #17324d;
  font-size: 18px;
  font-weight: 900;
}

.question-board {
  display: grid;
  gap: 16px;
  flex: 1;
  align-content: center;
  min-height: 360px;
  padding: 34px;
  border: 1px solid #d2dfd8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(35, 54, 74, 0.1);
}

.step-kicker {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 8px;
  color: #145438;
  background: #e5f6ed;
  font-weight: 900;
}

.child-stage h2 {
  margin: 0;
  color: #17324d;
  font-size: 40px;
}

.child-prompt {
  margin: 0;
  color: #1f2937;
  font-size: 30px;
  line-height: 1.65;
  font-weight: 800;
}

.child-primary-action {
  display: grid;
  place-items: center;
}

.speak-button {
  width: 150px;
  height: 150px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: radial-gradient(circle at 35% 28%, #ff9b6a 0%, #f05d54 52%, #c93844 100%);
  box-shadow: 0 20px 42px rgba(201, 56, 68, 0.25);
  font-size: 26px;
  font-weight: 900;
}

.speak-button:disabled {
  opacity: 0.72;
}

.voice-sim {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.voice-sim button {
  min-height: 68px;
  border: 1px solid #bfd2df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #17324d;
  font-size: 18px;
  font-weight: 900;
}

.child-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.child-input input {
  width: 100%;
  min-height: 56px;
  border: 1px solid #bfd2df;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 17px;
}

.child-input .secondary-button {
  min-height: 56px;
}

.child-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
  border: 1px solid #d4e0d9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.child-side h3 {
  margin: 0 0 12px;
  color: #3f4f5e;
  font-size: 16px;
}

.child-chat {
  max-height: none;
  margin: 0 0 16px;
  overflow: visible;
}

.child-chat .chat-turn {
  background: rgba(255, 255, 255, 0.86);
}

.child-step-list {
  margin: auto 0 0;
  padding-left: 22px;
  color: #6b7280;
  font-weight: 700;
}

.step-list li.active {
  color: var(--blue);
  font-weight: 800;
}

.voice-debug-shell {
  min-height: 100dvh;
  padding: 28px;
  background: #f4f8fb;
}

.voice-debug-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 20px;
}

.voice-debug-header h1 {
  margin: 0;
  color: #17324d;
  font-size: 38px;
  line-height: 1.15;
}

.voice-debug-header span {
  color: #5b6875;
  font-weight: 700;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  color: #17324d;
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.voice-debug-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.voice-debug-controls,
.voice-debug-player,
.voice-score-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d7e2ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(35, 54, 74, 0.08);
}

.voice-debug-controls label,
.voice-score-panel label,
.cosy-grid label,
.voice-instruct label {
  display: grid;
  gap: 7px;
  color: #3f4f5e;
  font-weight: 900;
}

.voice-debug-controls input,
.voice-debug-controls select,
.voice-debug-player textarea,
.voice-score-panel textarea,
.voice-debug-output input,
.cosy-grid input,
.voice-instruct textarea {
  width: 100%;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  padding: 11px 12px;
  color: #17324d;
  background: #fbfdff;
  font: inherit;
  font-weight: 700;
}

.voice-debug-controls input:disabled,
.voice-instruct textarea:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.voice-mode-tabs,
.voice-candidates,
.sample-tabs {
  display: grid;
  gap: 8px;
}

.voice-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voice-mode-tabs button {
  min-height: 44px;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  color: #17324d;
  background: #fbfdff;
  font-weight: 900;
}

.voice-mode-tabs button.active {
  border-color: #2f7bff;
  background: #edf4ff;
}

.voice-candidates button,
.sample-tabs button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  padding: 10px;
  color: #17324d;
  background: #fbfdff;
  text-align: left;
}

.voice-candidates button.active,
.sample-tabs button.active {
  border-color: #2f7bff;
  background: #edf4ff;
}

.voice-candidates span {
  color: #687887;
  font-size: 13px;
  font-weight: 700;
}

.voice-advanced,
.voice-instruct,
.cosy-diagnostic {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfe;
}

.voice-advanced summary,
.cosy-diagnostic summary {
  cursor: pointer;
  color: #17324d;
  font-weight: 900;
}

.voice-advanced label {
  margin-top: 10px;
}

.voice-instruct.disabled {
  background: #f8fafc;
}

.voice-checkbox {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
}

.voice-checkbox input {
  width: auto;
}

.sample-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sample-tabs button {
  min-height: 46px;
  place-items: center;
  text-align: center;
  font-weight: 900;
}

.voice-textarea-label,
.voice-debug-output label {
  display: grid;
  gap: 7px;
  color: #3f4f5e;
  font-weight: 900;
}

.voice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-debug-player audio {
  width: 100%;
}

.voice-param-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voice-param-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fbff;
}

.voice-param-grid span {
  display: block;
  margin-bottom: 5px;
  color: #687887;
  font-size: 12px;
  font-weight: 900;
}

.voice-param-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: #17324d;
  font-size: 13px;
}

.voice-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-result span,
.voice-result strong {
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef7f1;
  color: #145438;
  font-size: 13px;
  font-weight: 900;
}

.voice-result strong {
  background: #fff0f0;
  color: #b4232c;
}

.voice-debug-output {
  display: grid;
  gap: 10px;
}

.voice-debug-output input {
  color: #456;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.cosy-diagnostic {
  margin-top: 6px;
}

.cosy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.voice-score-panel h2 {
  margin: 0;
  color: #17324d;
  font-size: 20px;
}

.score-grid {
  display: grid;
  gap: 10px;
}

@media (max-width: 980px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
    gap: 12px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav button {
    text-align: center;
  }

  .mode-note {
    display: none;
  }

  .status-panel {
    margin-top: 0;
  }

  .parent-layout,
  .upload-layout,
  .training-layout,
  .graph-grid,
  .child-layout,
  .voice-debug-layout {
    grid-template-columns: 1fr;
  }

  .voice-sim {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .child-shell .workspace {
    padding: 14px;
  }

  .child-layout {
    min-height: calc(100vh - 28px);
  }

  .child-side {
    display: none;
  }

  .child-stage h2 {
    font-size: 30px;
  }

  .child-prompt {
    font-size: 23px;
  }

  .teacher-card p {
    font-size: 18px;
  }

  .lesson-voice-panel {
    grid-template-columns: 1fr;
  }

  .lesson-audio-status {
    justify-self: start;
    max-width: none;
  }

  .lesson-asr-panel {
    grid-template-columns: 1fr;
  }

  .question-board {
    min-height: 250px;
    padding: 24px;
  }

  .speak-button {
    width: 112px;
    height: 112px;
    font-size: 23px;
  }

  .child-input {
    grid-template-columns: 1fr;
  }

  .voice-debug-shell {
    padding: 14px;
  }

  .voice-debug-header {
    align-items: start;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 14px;
  }

  .screen-header h2 {
    font-size: 24px;
    line-height: 1.25;
  }

  .upload-panel,
  .result-panel,
  .panel {
    padding: 14px;
  }

  .dropzone {
    height: min(58vh, 360px);
  }

  .question-list,
  .node-list {
    max-height: none;
  }

  .plan-meta span,
  .focus-list span {
    border-radius: 8px;
  }

  .child-shell .workspace {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .child-layout {
    min-height: calc(100dvh - 22px);
  }

  .child-stage {
    gap: 12px;
  }

  .lesson-progress {
    gap: 5px;
  }

  .lesson-progress span {
    height: 8px;
  }

  .question-board {
    min-height: 220px;
    align-content: start;
  }

  .voice-sim {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .voice-sim button {
    min-height: 54px;
    font-size: 16px;
  }

  .child-input {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 8px;
    border: 1px solid #d7e2ea;
    border-radius: 8px;
    background: rgba(244, 251, 255, 0.94);
    box-shadow: 0 -8px 24px rgba(35, 54, 74, 0.08);
  }

  .voice-debug-header {
    display: grid;
  }

  .voice-debug-header h1 {
    font-size: 30px;
  }

  .sample-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-param-grid {
    grid-template-columns: 1fr;
  }

  .cosy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #app:not(.child-shell) {
    min-height: 100dvh;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand p {
    font-size: 12px;
  }

  .workspace {
    padding: 12px;
  }

  .screen-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-header .ghost-button {
    width: 100%;
  }

  .parent-layout {
    gap: 12px;
  }

  .upload-panel h3,
  .result-panel h3,
  .panel h3 {
    font-size: 16px;
  }

  .dropzone {
    height: min(52vh, 300px);
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    min-height: 46px;
    padding: 11px 14px;
  }

  .analysis-summary {
    grid-template-columns: 1fr;
  }

  .question-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .priority {
    width: fit-content;
  }

  .voice-sim {
    grid-template-columns: 1fr;
  }

  .child-brand strong {
    font-size: 18px;
  }

  .child-mark,
  .teacher-avatar {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  .child-stage h2 {
    font-size: 26px;
  }

  .child-prompt {
    font-size: 21px;
  }

  .teacher-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .teacher-card p {
    font-size: 16px;
    line-height: 1.55;
  }

  .question-board {
    min-height: 200px;
    padding: 18px;
    gap: 10px;
  }

  .child-topbar {
    gap: 10px;
  }

  .parent-exit {
    min-width: 58px;
    min-height: 42px;
  }

  .speak-button {
    width: 96px;
    height: 96px;
    font-size: 21px;
  }

  .child-input {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .child-input input,
  .child-input .secondary-button {
    min-height: 48px;
  }
}

@media (max-width: 390px) {
  .child-prompt {
    font-size: 19px;
  }

  .child-stage h2 {
    font-size: 23px;
  }

  .voice-sim button {
    font-size: 15px;
  }

  .child-input {
    grid-template-columns: 1fr;
  }
}
