:root {
  --bg: #f7fbff;
  --text: #17211c;
  --muted: #667069;
  --panel: #ffffff;
  --line: #dfe5df;
  --green: #21a66a;
  --green-dark: #0d6b45;
  --lime: #b7ee5d;
  --orange: #ff8a1f;
  --orange-soft: #fff0df;
  --cyan: #2fc7ee;
  --gold: #d69822;
  --red: #c2412d;
  --blue: #2f6fed;
  --shadow: 0 20px 48px rgba(37, 73, 95, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 138, 31, 0.18), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(47, 199, 238, 0.18), transparent 28%),
    radial-gradient(circle at 72% 54%, rgba(33, 166, 106, 0.1), transparent 30%),
    linear-gradient(180deg, #fffaf4 0%, var(--bg) 46%, #f2f8ff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  min-height: 348px;
  padding: 30px;
  border: 1px solid rgba(47, 199, 238, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 34%, rgba(255, 255, 255, 0.22) 58%, rgba(255, 255, 255, 0) 100%),
    url("./assets/xiaoyuan-coach-bg.jpg") right center / cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 72px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.48), transparent);
  pointer-events: none;
}

.header > * {
  position: relative;
  z-index: 1;
}

.header > div:first-child {
  max-width: 520px;
}

.eyebrow {
  margin: 8px 0 6px;
  color: var(--green);
  font-weight: 700;
}

.brand-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #25533d;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), #ffb13b);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 138, 31, 0.24);
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 138, 31, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #8c4a11;
  font-size: 13px;
  font-weight: 700;
}

.hero-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 260px;
  align-self: end;
}

.mascot-stage {
  display: none;
}

.mascot-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.32), transparent 36%),
    radial-gradient(circle at 82% 20%, rgba(47, 199, 238, 0.2), transparent 26%);
  pointer-events: none;
}

.signal-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(47, 199, 238, 0.8);
}

.dot-a {
  top: 22px;
  right: 54px;
  animation: floatDot 2.8s ease-in-out infinite;
}

.dot-b {
  left: 44px;
  bottom: 34px;
  animation: floatDot 3.4s ease-in-out infinite reverse;
}

.mascot {
  position: relative;
  width: 88px;
  height: 82px;
  margin-top: -12px;
  display: none;
  animation: mascotFloat 3s ease-in-out infinite;
}

.ear {
  position: absolute;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange);
}

.ear-left {
  left: 3px;
}

.ear-right {
  right: 3px;
}

.face {
  position: absolute;
  left: 11px;
  top: 13px;
  width: 66px;
  height: 62px;
  border-radius: 26px 26px 30px 30px;
  background: linear-gradient(180deg, #ffb23f, var(--orange));
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08), 0 18px 30px rgba(255, 138, 31, 0.24);
}

.face::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 30px;
  border-radius: 18px;
  background: #fff2df;
}

.eye,
.smile {
  position: absolute;
  z-index: 1;
}

.eye {
  top: 26px;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background: #113525;
}

.eye-left {
  left: 26px;
}

.eye-right {
  right: 26px;
}

.smile {
  left: 34px;
  top: 46px;
  width: 20px;
  height: 10px;
  border-bottom: 3px solid #113525;
  border-radius: 0 0 20px 20px;
}

.headset {
  position: absolute;
  right: 1px;
  top: 28px;
  width: 18px;
  height: 24px;
  border: 3px solid #17211c;
  border-left: 0;
  border-radius: 0 14px 14px 0;
}

.mascot-card {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #8c4a11;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(28, 65, 45, 0.12);
  backdrop-filter: blur(8px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.status {
  min-width: 210px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  box-shadow: 0 12px 28px rgba(37, 73, 95, 0.1);
}

.status.ok {
  color: var(--green-dark);
  border-color: rgba(31, 122, 84, 0.24);
  background: #eef8f2;
}

.status.warn {
  color: var(--gold);
  border-color: rgba(183, 121, 31, 0.25);
  background: #fff8e8;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 16px;
}

.panel,
.score-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.script-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#scriptFileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.file-hint {
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.file-hint.warn {
  color: var(--red);
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  outline: none;
  color: var(--text);
  line-height: 1.7;
  background: #fbfcfb;
}

textarea:focus,
select:focus {
  border-color: rgba(31, 122, 84, 0.6);
  box-shadow: 0 0 0 3px rgba(31, 122, 84, 0.12);
}

.script-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  outline: none;
}

.record-panel {
  display: flex;
  flex-direction: column;
}

.timer {
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.meter-wrap {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde5dd;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.08s linear;
}

#recordHint {
  color: var(--muted);
  line-height: 1.5;
}

.sentence-coach {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(25, 161, 95, 0.18);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfffb, #f2fbf4);
}

.sentence-head,
.sentence-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sentence-head span {
  color: var(--green-dark);
  font-weight: 800;
}

.sentence-head strong {
  color: var(--muted);
  font-size: 13px;
}

#currentSentence {
  min-height: 74px;
  color: var(--text);
  line-height: 1.7;
}

.sentence-actions button {
  flex: 1;
  height: 38px;
}

.sentence-actions .confirmed {
  background: var(--green-dark);
  color: #fff;
}

.record-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.audio-review {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(47, 111, 237, 0.16);
  border-radius: 10px;
  background: #f7fbff;
}

.audio-review.hidden {
  display: none;
}

.audio-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audio-review-head span {
  color: var(--green-dark);
  font-weight: 800;
}

.audio-review-head a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.audio-review audio {
  width: 100%;
}

#audioHint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

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

.primary-btn {
  background: linear-gradient(135deg, var(--orange), #ffad38);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 138, 31, 0.16);
}

.primary-btn.recording {
  background: var(--red);
}

.secondary-btn {
  background: #edf1ed;
  color: var(--text);
}

.ghost-btn {
  height: 36px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.full {
  width: 100%;
  margin-top: 10px;
}

.transcript-box {
  margin-top: auto;
}

.transcript-box textarea {
  min-height: 122px;
}

.results {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.score-card {
  min-height: 142px;
  padding: 18px;
}

.score-card span {
  color: var(--muted);
  font-size: 14px;
}

.score-card strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 42px;
  line-height: 1;
}

.score-card p {
  color: var(--muted);
  line-height: 1.5;
}

.score-card.total {
  color: #fff;
  background:
    linear-gradient(135deg, #f06f16, #ff9f29 56%, #39c7ed);
  border-color: rgba(255, 138, 31, 0.28);
  position: relative;
  overflow: hidden;
}

.score-card.total::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.score-card.total::before {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
  transform: rotate(10deg);
}

.score-card.total.pass {
  animation: scoreGlow 1.5s ease-in-out;
}

.score-card.total.pass strong {
  animation: scorePop 0.75s cubic-bezier(0.18, 0.9, 0.22, 1.25);
}

.score-card.total span,
.score-card.total p {
  color: rgba(255, 255, 255, 0.78);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.feedback-panel {
  box-shadow: none;
}

.rule-note {
  margin: -4px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

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

.feedback-item {
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #f7faf7;
  padding: 12px 14px;
  line-height: 1.6;
}

.feedback-item.warn {
  border-left-color: var(--gold);
}

.feedback-item.bad {
  border-left-color: var(--red);
}

.feedback-item strong {
  display: block;
  margin-bottom: 4px;
}

.empty {
  color: var(--muted);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 179, 59, 0.26), transparent 28%),
    rgba(15, 35, 25, 0.24);
  backdrop-filter: blur(8px);
}

.celebration.hidden {
  display: none;
}

.celebration-card {
  position: relative;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 138, 31, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 244, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(255, 138, 31, 0.2), transparent 34%);
  text-align: center;
  box-shadow: 0 34px 92px rgba(95, 58, 24, 0.24);
  animation: cardRise 0.42s cubic-bezier(0.18, 0.9, 0.22, 1.2);
  overflow: hidden;
}

.celebration-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255, 138, 31, 0.22);
  border-radius: 18px;
  pointer-events: none;
}

.celebration-card h2 {
  font-size: 24px;
}

.celebration-card strong {
  display: block;
  margin: 10px 0;
  color: var(--orange);
  font-size: 72px;
  line-height: 1;
  text-shadow: 0 12px 30px rgba(255, 138, 31, 0.18);
}

.celebration-card p {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.spark-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 34px;
  padding: 0 14px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff0df, #ffe0b7);
  color: #7b3d08;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(255, 138, 31, 0.18);
}

.celebration-visual {
  position: relative;
  width: 168px;
  height: 128px;
  margin: 0 auto 8px;
}

.celebration-mascot {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 2px;
  width: 156px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(255, 138, 31, 0.22));
}

.trophy-badge {
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 58px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(145deg, #ffbe45, #ff7b18 68%, #e95712);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow:
    inset 0 -10px 0 rgba(123, 61, 8, 0.14),
    0 18px 34px rgba(255, 138, 31, 0.3);
  animation: prizePulse 1.5s ease-in-out infinite;
}

.trophy-badge::before,
.trophy-badge::after {
  content: none;
}

.trophy-badge::before {
  left: -18px;
}

.trophy-badge::after {
  right: -18px;
}

.burst {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(47, 199, 238, 0.7);
  animation: floatDot 2.4s ease-in-out infinite;
}

.burst-a {
  left: 6px;
  top: 8px;
}

.burst-b {
  right: 4px;
  bottom: 12px;
  background: var(--lime);
  animation-delay: 0.35s;
}

.prep-overlay,
.scoring-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 24%, rgba(47, 199, 238, 0.18), transparent 28%),
    rgba(14, 38, 26, 0.26);
  backdrop-filter: blur(8px);
}

.prep-overlay.hidden,
.scoring-overlay.hidden {
  display: none;
}

.prep-card,
.scoring-card {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96));
  box-shadow: 0 34px 92px rgba(37, 73, 95, 0.24);
  text-align: center;
  animation: cardRise 0.38s cubic-bezier(0.18, 0.9, 0.22, 1.2);
}

.prep-card {
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 244, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(255, 138, 31, 0.18), transparent 38%);
}

.prep-label {
  margin: 12px 0 6px;
  color: var(--orange);
  font-weight: 800;
}

.prep-card h2,
.scoring-card h2 {
  font-size: 24px;
}

.prep-card > p:last-of-type,
.scoring-card p {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.prep-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.prep-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 18px;
}

.prep-checks span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 138, 31, 0.18);
  border-radius: 12px;
  background: #fff8ef;
  color: #8c4a11;
  font-size: 13px;
  font-weight: 800;
}

.mini-mascot {
  position: relative;
  width: 150px;
  height: 104px;
  margin: 0 auto;
  filter: drop-shadow(0 18px 26px rgba(255, 138, 31, 0.22));
}

.mini-mascot::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 138, 31, 0.22), transparent 68%);
}

.mini-mascot::after {
  content: "";
  display: none;
}

.mini-mascot img {
  position: relative;
  z-index: 1;
  width: 150px;
  height: 104px;
  object-fit: contain;
}

.mini-ear {
  position: absolute;
  top: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff9f29, #ff7b18);
  box-shadow: inset 0 -7px 0 rgba(135, 66, 12, 0.12);
}

.mini-ear.left {
  left: 10px;
}

.mini-ear.right {
  right: 10px;
}

.mini-face {
  position: absolute;
  left: 22px;
  top: 18px;
  width: 74px;
  height: 68px;
  border-radius: 30px 30px 34px 34px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.34), transparent 24%),
    linear-gradient(180deg, #ffb23f, var(--orange));
  box-shadow:
    inset 0 -10px 0 rgba(123, 61, 8, 0.12),
    0 10px 20px rgba(255, 138, 31, 0.16);
  z-index: 2;
}

.mini-face::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 9px;
  height: 36px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 76%, rgba(255, 138, 31, 0.18), transparent 16%),
    radial-gradient(circle at 78% 76%, rgba(255, 138, 31, 0.18), transparent 16%),
    #fff2df;
}

.mini-face::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 35px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: #113525;
  box-shadow:
    20px 0 0 #113525,
    10px 18px 0 -2px #113525;
}

.mini-headset {
  position: absolute;
  right: 17px;
  top: 33px;
  width: 24px;
  height: 32px;
  border: 5px solid #ffffff;
  border-left: 0;
  border-radius: 0 18px 18px 0;
  box-shadow: 0 4px 12px rgba(37, 73, 95, 0.12);
  z-index: 5;
}

.mini-mic {
  position: absolute;
  right: 10px;
  top: 60px;
  width: 23px;
  height: 5px;
  border-radius: 999px;
  background: #ffffff;
  transform: rotate(12deg);
  z-index: 6;
}

.mini-mic::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(47, 199, 238, 0.45);
}

.scoring-card {
  padding: 30px 28px;
  overflow: hidden;
}

.scoring-hero {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 112px;
  margin: 0 auto 12px;
}

.scan-ring {
  width: 92px;
  height: 92px;
  margin: 0;
  border-radius: 50%;
  border: 8px solid rgba(47, 199, 238, 0.14);
  border-top-color: var(--orange);
  border-right-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}

.scan-ring::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 31, 0.22), transparent 64%);
}

.wave-bars {
  position: absolute;
  inset: auto 0 10px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 6px;
}

.wave-bars span {
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--orange));
  animation: waveLift 0.72s ease-in-out infinite;
}

.wave-bars span:nth-child(2) {
  animation-delay: 0.08s;
}

.wave-bars span:nth-child(3) {
  animation-delay: 0.16s;
}

.wave-bars span:nth-child(4) {
  animation-delay: 0.24s;
}

.wave-bars span:nth-child(5) {
  animation-delay: 0.32s;
}

.scoring-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.scoring-steps span {
  position: relative;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #e6eef3;
  border-radius: 12px;
  background: #f5f8fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.scoring-steps span.active {
  border-color: rgba(255, 138, 31, 0.3);
  background: linear-gradient(135deg, #fff0df, #fff8ef);
  color: #8c4a11;
  box-shadow: 0 10px 22px rgba(255, 138, 31, 0.14);
}

.scoring-steps span.done {
  border-color: rgba(33, 166, 106, 0.24);
  background: #eefaf4;
  color: var(--green-dark);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3ee;
}

.progress-track span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--cyan), var(--green));
  animation: progressSweep 1.1s ease-in-out infinite;
}

@keyframes scorePop {
  0% {
    transform: scale(0.72);
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes scoreGlow {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(183, 238, 93, 0.28), 0 26px 70px rgba(25, 161, 95, 0.24);
  }
}

@keyframes prizePulse {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }
  50% {
    transform: scale(1.06) rotate(2deg);
  }
}

@keyframes waveLift {
  0%,
  100% {
    height: 18px;
    opacity: 0.72;
  }
  50% {
    height: 44px;
    opacity: 1;
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mascotFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatDot {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.15);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes progressSweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

@media (max-width: 860px) {
  .app {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .header,
  .practice-grid,
  .results {
    grid-template-columns: 1fr;
  }

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

  .report-actions {
    width: 100%;
    justify-content: stretch;
  }

  .report-actions .ghost-btn {
    flex: 1;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 18px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 48%, rgba(255, 255, 255, 0.36) 100%),
      url("./assets/xiaoyuan-coach-bg.jpg") 72% bottom / 760px auto no-repeat;
  }

  .hero-side,
  .mascot-stage {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .mascot-stage {
    min-height: 190px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.1)),
      url("./assets/xiaoyuan-coach-bg.jpg") 72% center / cover no-repeat;
  }

  .status {
    text-align: left;
  }

  .script-tools,
  .panel-title {
    align-items: flex-start;
  }

  .panel-title {
    flex-wrap: wrap;
  }

  .practice-grid {
    display: grid;
  }

  .script-actions,
  .record-actions {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 220px;
  }

  .prep-actions {
    grid-template-columns: 1fr;
  }

  .prep-checks,
  .scoring-steps {
    grid-template-columns: 1fr;
  }
}
