/* 白杨朗读台：左边课文 + 操作，右边雷达图 + 点评 */
.tabs {
  display: flex;
  gap: 0.5rem;
  z-index: 1;
  margin-left: 1rem;
}
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 7.2rem;
  height: 3.4rem;
  padding: 0 1rem;
  border: 0.12rem solid transparent;
  border-radius: 0.9rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.15;
}
.tabs button small {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-2);
}
.tabs button.on {
  background: var(--card);
  border-color: var(--ink);
  box-shadow: 0 0.2rem 0 var(--ink);
}
.tabs button:disabled {
  opacity: 0.45;
  cursor: default;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: 1.2rem;
  height: calc(100vh - 4.6rem);
  padding: 1.2rem 1.4rem 1.3rem;
  background:
    radial-gradient(ellipse at 10% 110%, rgba(242, 163, 58, 0.18), transparent 55%),
    var(--paper);
}

/* —— 左：课文 */
.left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.3rem 1.6rem 1.2rem;
}
.meta {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 1.1rem;
  color: var(--ink-2);
}
.meta .tone b {
  margin-left: 0.4rem;
  padding: 0.15rem 0.7rem;
  border-radius: 0.4rem;
  background: var(--ink);
  color: #fde779;
  font-family: var(--song);
  letter-spacing: 0.1em;
}
.passage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  margin: 0.8rem 0 0.6rem;
  overflow: hidden;
}
.passage {
  width: 100%;
  font-family: var(--kai);
  font-size: 3rem;
  line-height: 2.25;
  letter-spacing: 0.04em;
  text-align: justify;
  color: var(--ink);
}
.passage.short {
  text-align: center;
}
.passage .ch {
  position: relative;
  display: inline-block;
  transition: color 0.12s, background 0.12s;
  border-radius: 0.15em;
}
/* 范读跟读高亮 */
.passage .ch.past {
  color: var(--pine);
}
.passage .ch.on {
  color: #fff;
  background: var(--sun-deep);
  transform: translateY(-0.04em);
}
/* 着重号：重音 */
.passage .ch.stress::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.12em;
  width: 0.16em;
  height: 0.16em;
  margin-left: -0.08em;
  border-radius: 50%;
  background: var(--sun-deep);
}
.passage .mk {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 700;
  vertical-align: 0.9em;
  margin: 0 0.06em;
  color: var(--sun-deep);
  letter-spacing: -0.1em;
}
.passage .mk.len {
  vertical-align: 0.55em;
  font-size: 0.55em;
  letter-spacing: 0;
}
/* 测评结果标注 */
.passage .ch.wrong {
  color: var(--red);
  text-decoration: underline wavy var(--red);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
}
.passage .ch.skip {
  color: var(--ink-3);
  background: repeating-linear-gradient(135deg, transparent 0 0.12em, rgba(179, 57, 43, 0.12) 0.12em 0.2em);
}
.passage .ch.weak::after {
  background: var(--red);
  box-shadow: 0 0 0 0.08em var(--red-soft);
}
.passage .ch.weak {
  background: rgba(242, 163, 58, 0.16);
}
.passage .mk.missed {
  color: var(--red);
  animation: blink 1.2s ease-in-out 3;
}
.passage .mk.miss {
  color: var(--red);
  font-size: 0.55em;
  vertical-align: 0.75em;
  animation: blink 1.2s ease-in-out 3;
}
.passage .mk.extra {
  color: #8a6bbf;
  font-size: 0.6em;
  vertical-align: 0.15em;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.passage .pending {
  display: block;
  text-align: center;
  font-family: var(--sans);
  font-size: 1.4rem;
  color: var(--ink-3);
  line-height: 1.8;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  padding: 0.6rem 0 0.8rem;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.legend i {
  font-style: normal;
  margin-right: 0.3rem;
  font-weight: 700;
}
.legend .lg-pause,
.legend .lg-len {
  color: var(--sun-deep);
}
.legend .lg-stress,
.legend .lg-weak,
.legend .lg-wrong {
  font-family: var(--kai);
  position: relative;
}
.legend .lg-stress::after,
.legend .lg-weak::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.25em;
  width: 0.3em;
  height: 0.3em;
  margin-left: -0.15em;
  border-radius: 50%;
  background: var(--sun-deep);
}
.legend .lg-weak::after {
  background: var(--red);
}
.legend .lg-wrong {
  color: var(--red);
  text-decoration: underline wavy var(--red);
}
.legend .lg-miss {
  color: var(--red);
}
.legend .lg-extra {
  color: #8a6bbf;
}
.legend .after-result {
  display: none;
}
.has-result .legend .after-result {
  display: inline;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.steps {
  display: flex;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  flex: 1;
  position: relative;
  padding: 0.45rem 0.2rem 0.45rem 1.9rem;
  border-radius: 0.5rem;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 0.98rem;
  white-space: nowrap;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.45rem;
  top: 50%;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: -0.6rem;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.2rem;
  text-align: center;
}
.steps li.done {
  color: var(--pine);
  background: var(--pine-soft);
}
.steps li.done::before {
  content: '✓';
  background: var(--pine);
  color: #fff;
}
.steps li.now {
  color: var(--ink);
  background: #fde779;
  font-weight: 700;
  box-shadow: inset 0 0 0 0.12rem var(--ink);
}
.steps li.now::before {
  background: var(--ink);
  color: #fde779;
}
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
#btnRead {
  min-width: 15rem;
}
#btnRead.recording {
  background: var(--red);
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0.25rem 0 var(--ink), 0 0 0 0.6rem rgba(179, 57, 43, 0.18);
  }
}
.rec-info {
  display: none;
  align-items: center;
  gap: 0.6rem;
  color: var(--red);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.recording-now .rec-info {
  display: inline-flex;
}
#btnRedo,
#btnPlayback {
  display: none;
}
.recording-now #btnRedo,
.can-redo #btnRedo,
.has-recording #btnPlayback {
  display: inline-flex;
}
.recording-now #btnPlayback {
  display: none;
}

/* —— 右：雷达图 + 点评 */
.right {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.1rem 1.4rem 1.2rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--song);
  font-size: 1.45rem;
  letter-spacing: 0.1em;
}
.series-legend {
  display: flex;
  gap: 1.1rem;
  font-size: 1rem;
  color: var(--ink-2);
}
.series-legend i {
  display: inline-block;
  width: 1.8rem;
  height: 0;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.series-legend .s1 i {
  border-top: 0.22rem dashed var(--ochre);
}
.series-legend .s2 i {
  border-top: 0.24rem solid var(--pine);
}
.series-legend .s2 {
  opacity: 0.35;
}
.has-r2 .series-legend .s2 {
  opacity: 1;
}
.radar-box {
  position: relative;
  flex: 1 1 auto;
  min-height: 20rem;
}
.radar {
  position: absolute;
  inset: 0;
}
.progress-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
  font-family: var(--song);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0.5rem 2rem rgba(47, 93, 80, 0.4);
}
.progress-burst.go {
  animation: burst 2.6s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) scale(0.85);
  }
}

.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.7rem;
  margin: 0.3rem 0 0.6rem;
  flex: none;
}
.score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.7rem;
  background: var(--paper);
  font-size: 1.02rem;
}
.score .name {
  flex: 1;
  color: var(--ink-2);
  white-space: nowrap;
}
.score .name .tag {
  margin-left: 0.25rem;
  padding: 0 0.4rem;
  font-size: 0.72rem;
}
.score .v1 {
  color: var(--ochre);
  font-weight: 700;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.score .arrow {
  color: var(--ink-3);
  font-size: 0.9rem;
}
.score .v2 {
  color: var(--pine);
  font-weight: 700;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.score .diff {
  min-width: 2.6rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}
.score .diff.up {
  background: var(--pine);
  color: #fff;
  animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.score .diff.down {
  background: var(--paper-2);
  color: var(--ink-3);
}
@keyframes pop {
  from {
    transform: scale(0.2);
    opacity: 0;
  }
}

.review {
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  background: #fff8e4;
  border: 0.1rem solid #f3d999;
}
.review-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.review .focus {
  font-size: 1.2rem;
  color: var(--red);
}
.review .comment {
  margin: 0.5rem 0 0;
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--ink);
}
.teacher {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.7rem;
  font-size: 1rem;
  color: var(--ink-2);
}
.teacher input {
  flex: 1;
  height: 2.4rem;
  accent-color: var(--pine);
}
.teacher b {
  min-width: 2.4rem;
  font-size: 1.3rem;
  color: var(--pine);
  text-align: right;
}
.teacher.changed span::after {
  content: ' ✓已补评';
  color: var(--pine);
}

.empty {
  position: absolute;
  inset: 4rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--card);
  color: var(--ink-3);
  font-size: 1.2rem;
  line-height: 1.8;
  text-align: center;
  z-index: 2;
}
.empty svg {
  width: 9rem;
}
.has-result .empty {
  display: none;
}
.is-offline .only-offline {
  display: inline-flex;
}
.only-offline {
  display: none;
}
.passage .unit {
  display: inline-block;
  white-space: nowrap;
}
