/* ── Structure exercise UI ───────────────────────────────────────── */

.st-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: clamp(10px, 1.5vh, 16px);
}
.st-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.st-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.st-back-btn:hover { background: rgba(255,255,255,0.15); }
.st-title {
  font-size: clamp(1.05rem, 1.8vh, 1.3rem);
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.08);
  padding: 6px 14px;
  border-radius: 8px;
  flex: 1;
}
.st-progress {
  font-size: clamp(0.9rem, 1.32vh, 1.08rem);
  color: #fff;
  font-weight: 600;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}
/* Structure progress bar — mirrors .ex-progress-* */
.st-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.st-progress-label, .st-progress-total {
  font-size: clamp(0.82rem, 1.1vh, 0.95rem);
  font-weight: 700;
  color: var(--text);
  min-width: 20px;
  text-align: center;
}
.st-progress-track {
  flex: 1;
  height: clamp(8px, 1.2vh, 12px);
  background: var(--surface2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.st-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4A9E6B, #5CC87E);
  border-radius: 6px;
  transition: width 0.4s ease;
}
.st-score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(4px, 0.8vh, 8px) 0;
  font-size: clamp(0.94rem, 1.32vh, 1.08rem);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: clamp(8px, 1.2vh, 14px);
}
.st-prompt {
  font-size: clamp(1.26rem, 2.16vh, 1.56rem);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: clamp(4px, 0.6vh, 8px);
  line-height: 1.4;
}
.st-speak-btn {
  cursor: pointer;
  font-size: 1.1em;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
  margin-right: 4px;
}
.st-speak-btn:hover { opacity: 1; transform: scale(1.15); }
.st-zh-btn { color: #f0c040; opacity: 0.85; font-size: 1.3em; }
.st-en-narrate-btn { font-size: 0.7em; opacity: 0.6; }
.st-zh-btn:hover { opacity: 1; }
.st-zh-audio-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(8px, 1.5vh, 14px);
  padding: 8px 16px;
  background: rgba(240,192,64,0.08);
  border-radius: 12px;
}
.st-zh-audio-text {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.2rem, 2.5vh, 1.8rem);
  font-weight: 700;
  color: var(--text);
}
.st-lesson-sentence-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: clamp(10px, 2vh, 18px) 0;
  padding: 10px 16px;
  background: rgba(240,192,64,0.08);
  border-radius: 12px;
  cursor: pointer;
}
.st-lesson-zh-text {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 3.5vh, 2.4rem);
  font-weight: 700;
  color: var(--text);
}
.st-grammar {
  font-size: clamp(2.16rem, 3vh, 2.64rem);
  color: #fff;
  text-align: center;
  margin-bottom: clamp(14px, 2.5vh, 24px);
  font-weight: 600;
}
.st-grammar ruby { color: #fff; }
.st-grammar rt { font-size: 1em; color: #fff; }

/* Sentence display (fill-blank) */
.st-sentence {
  font-size: clamp(2rem, 5vh, 3rem);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: clamp(4px, 0.8vh, 8px);
  line-height: 1.4;
  font-family: 'Noto Serif SC', serif;
}
.st-sentence ruby rt {
  font-size: 0.54em;
  color: var(--accent, #f0c040);
}
.st-blank {
  display: inline-block;
  min-width: 3em;
  border-bottom: 3px solid var(--muted);
  margin: 0 4px;
  transition: all 0.3s;
}
.st-blank.filled {
  border-color: #4A9E6B;
  color: #C41E1E;
}

/* Answer slots (reorder) */
.st-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 1vw, 10px);
  margin-bottom: clamp(16px, 2.5vh, 24px);
  min-height: clamp(52px, 8vh, 70px);
  padding: clamp(6px, 1vh, 10px);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 2px dashed rgba(255,255,255,0.1);
}
.st-slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.st-slot-pinyin {
  font-size: 0.96em;
  color: var(--accent, #f0c040);
  min-height: 1.2em;
  margin-top: 4px;
  font-family: -apple-system, sans-serif;
}
.st-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(48px, 8vw, 72px);
  min-height: clamp(40px, 6vh, 56px);
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.15);
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.32rem, 3vh, 1.92rem);
  font-weight: 700;
  color: #C41E1E;
  transition: all 0.2s;
  cursor: pointer;
  padding: 4px 10px;
}
.st-slot.filled {
  background: #FFFFFC;
  border: none;
  box-shadow: 0 3px 0 0 #4A9E6B, 0 4px 3px rgba(0,0,0,0.12);
}
.st-slot.correct {
  box-shadow: 0 3px 0 0 #4A9E6B, 0 0 12px rgba(74,158,107,0.5);
}
.st-slot.wrong {
  animation: mg-shake 0.4s ease;
  box-shadow: 0 3px 0 0 #C41E1E, 0 0 12px rgba(196,30,30,0.4);
}

/* Word bank (reorder) */
.st-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 12px);
  margin-bottom: clamp(16px, 2.5vh, 24px);
}
.st-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.2vh, 12px) clamp(12px, 2vw, 18px);
  border-radius: 8px;
  background: #FFFFFC;
  border: none;
  box-shadow: 0 4px 0 0 #4A9E6B, 0 5px 3px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.9);
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.32rem, 3vh, 1.92rem);
  font-weight: 700;
  color: #C41E1E;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  user-select: none;
}
.st-word-pinyin {
  display: block;
  font-size: 0.66em;
  font-weight: 400;
  color: #333;
  margin-top: 2px;
  font-family: -apple-system, sans-serif;
}
.st-word:hover { transform: translateY(-2px); }
.st-word.used { opacity: 0.15; pointer-events: none; transform: scale(0.95); }

/* Options grid (fill-blank) */
.st-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.2vw, 12px);
  max-width: 320px;
  margin: 0 auto clamp(16px, 2.5vh, 24px);
}
.st-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.5vh, 16px) clamp(8px, 1.2vw, 14px);
  border-radius: 8px;
  background: #FFFFFC;
  border: none;
  box-shadow: 0 4px 0 0 #4A9E6B, 0 5px 3px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.9);
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.32rem, 3vh, 1.92rem);
  font-weight: 700;
  color: #C41E1E;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}
.st-option:hover { transform: translateY(-2px); }
.st-option.correct {
  box-shadow: 0 3px 0 0 #4A9E6B, 0 0 14px rgba(74,158,107,0.5);
  background: #e8f5e9;
}
.st-option.wrong {
  animation: mg-shake 0.4s ease;
  opacity: 0.4;
  pointer-events: none;
}

/* Check button */
.st-check-btn {
  display: block;
  margin: 0 auto;
  padding: clamp(10px, 1.5vh, 14px) clamp(28px, 5vw, 40px);
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #FFD700, #FFC107);
  color: #1a1a2e;
  font-size: clamp(1.08rem, 1.56vh, 1.26rem);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.st-check-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,215,0,0.3); }
.st-check-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.st-feedback {
  text-align: center;
  margin-top: clamp(10px, 1.5vh, 16px);
  font-size: clamp(1.02rem, 1.44vh, 1.2rem);
  font-weight: 700;
  min-height: 1.4em;
}
.st-feedback.correct { color: #4A9E6B; }
.st-feedback.wrong { color: #C41E1E; }

/* Lesson card */
.st-lesson {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: clamp(18px, 3vh, 28px) clamp(16px, 3vw, 24px);
  margin-bottom: clamp(12px, 2vh, 20px);
}
.st-lesson-title {
  font-size: clamp(2rem, 3.4vh, 2.4rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: clamp(10px, 1.5vh, 16px);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.st-lesson-body {
  font-size: clamp(1.6rem, 2.3vh, 1.9rem);
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  margin-bottom: clamp(16px, 2.5vh, 24px);
  text-align: center;
}
.st-lesson-breakdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  margin-bottom: clamp(16px, 2.5vh, 24px);
}
.st-lesson-breakdown .st-listen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(10px, 1.5vh, 16px) clamp(18px, 3vw, 28px);
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.72rem, 1vh, 0.85rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  align-self: center;
}
.st-lesson-breakdown .st-listen-btn:hover {
  border-color: rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.65);
}
.st-lesson-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.st-lesson-zh {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2.4rem, 5vh, 3.2rem);
  font-weight: 700;
  color: var(--text);
}
.st-lesson-pinyin {
  font-size: clamp(1.1rem, 1.8vh, 1.35rem);
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}
.st-lesson-en {
  font-size: clamp(1.0rem, 1.6vh, 1.25rem);
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}
.st-lesson-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: clamp(1.05rem, 1.5vh, 1.3rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.st-lesson-tip {
  font-size: clamp(1.44rem, 2.1vh, 1.7rem);
  color: rgba(255,255,255,0.85);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  margin-bottom: clamp(16px, 2.5vh, 24px);
  white-space: pre-line;
}
.st-lesson-btn {
  display: block;
  margin: 0 auto;
  padding: clamp(7px, 1vh, 10px) clamp(20px, 3.5vw, 28px);
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #FFD700, #FFC107);
  color: #1a1a2e;
  font-size: clamp(1.1rem, 1.6vh, 1.33rem);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.st-lesson-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,215,0,0.3); }
