:root {
  --bg: #fbf4eb;
  --bg-accent: #f9e4d1;
  --ink: #1f1b16;
  --muted: #6b5b4b;
  --card: #ffffff;
  --accent: #1c7c7c;
  --accent-2: #f28b5b;
  --accent-3: #f6c453;
  --ring: rgba(28, 124, 124, 0.25);
  --shadow: 0 18px 45px rgba(31, 27, 22, 0.12);
  --soft-shadow: 0 8px 20px rgba(31, 27, 22, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Noto Serif SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff8ee 0%, var(--bg) 45%),
    radial-gradient(circle at 20% 70%, #f7e2c7 0%, transparent 55%),
    linear-gradient(120deg, #fff1db 0%, #fbe8d1 55%, #f6f0e9 100%);
  min-height: 100vh;
  padding: 32px 20px 48px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  background: linear-gradient(135deg, #fff9f1 0%, #fff0df 60%, #ffe6d3 100%);
  border-radius: 24px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(242, 139, 91, 0.18);
  position: relative;
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(28, 124, 124, 0.25), transparent 70%);
  opacity: 0.8;
}

.header-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 27, 22, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--soft-shadow);
}

.header-link:hover {
  background: #fff;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.title-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 16px;
  font-size: 28px;
  box-shadow: 0 10px 20px rgba(28, 124, 124, 0.28);
}

.header h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.5px;
}

.header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.header-tips {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.header-tips span {
  background: rgba(28, 124, 124, 0.12);
  color: #165e5e;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.content {
  display: grid;
  gap: 20px;
}

.home-container {
  max-width: 1120px;
  min-height: calc(100vh - 80px);
  justify-content: center;
}

.home-content {
  gap: 0;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.entry-grid-home .entry-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 30px;
}

.entry-grid-home .entry-card h3 {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.08;
  max-width: 8em;
}

.entry-grid-home .entry-action {
  min-height: 52px;
  padding: 0 24px;
  font-size: 18px;
  box-shadow: var(--soft-shadow);
}

.entry-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 235, 0.96));
  border: 1px solid rgba(31, 27, 22, 0.08);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  opacity: 0.7;
  pointer-events: none;
}

.entry-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 54px rgba(31, 27, 22, 0.16);
}

.entry-card-assessment::after {
  background: radial-gradient(circle, rgba(28, 124, 124, 0.22), rgba(28, 124, 124, 0));
}

.entry-card-game::after {
  background: radial-gradient(circle, rgba(242, 139, 91, 0.24), rgba(242, 139, 91, 0));
}

.entry-card-arcade::after {
  background: radial-gradient(circle, rgba(28, 124, 124, 0.22), rgba(28, 124, 124, 0));
}

.entry-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(31, 27, 22, 0.06);
}

.entry-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-card h3 {
  margin: 0;
  font-size: 30px;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.entry-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 27, 22, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.entry-action {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
}

.entry-card-assessment .entry-action {
  background: var(--accent);
}

.entry-card-game .entry-action {
  background: var(--accent-2);
}

.entry-card-arcade .entry-action {
  background: linear-gradient(135deg, #1c7c7c, #4db3d8);
}

.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(31, 27, 22, 0.08);
  animation: fadeUp 0.6s ease;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  font-weight: 600;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 27, 22, 0.18);
  background: #fffdf9;
  font-size: 14px;
  font-family: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 27, 22, 0.18);
  background: #fffdf9;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

/* 参考文本框展开/收起样式 */
.reference-text-collapsed {
  max-height: 96px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.reference-text-expanded {
  max-height: 400px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.audio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-method-container {
  display: grid;
  gap: 16px;
}

.settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.settings-grid.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.settings-grid:not(.collapsed) {
  max-height: 1000px;
  opacity: 1;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.toggle-btn:hover {
  background: rgba(31, 27, 22, 0.08);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.toggle-btn.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.setting-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  background: #fffaf6;
}

.setting-wide {
  grid-column: 1 / -1;
}

.weights-title {
  font-weight: 700;
}

.weight-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.weight-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.weight-value {
  font-weight: 700;
  color: var(--muted);
}

.mode-toggle-wrapper {
  display: flex;
  align-items: center;
}

.mode-toggle {
  display: inline-flex;
  gap: 8px;
  background: rgba(31, 27, 22, 0.08);
  padding: 6px;
  border-radius: 999px;
}

.mode-btn span {
  font-size: 16px;
  margin-right: 6px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
}

.mode-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(31, 27, 22, 0.12);
}

.mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.experience-toggle {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.06);
  flex-wrap: wrap;
}

.experience-btn {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.experience-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(31, 27, 22, 0.1);
}

.experience-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.launcher-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: #fff9f2;
  border: 1px solid rgba(242, 139, 91, 0.14);
}

.launcher-copy h2 {
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1.15;
}

.launcher-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.launcher-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(28, 124, 124, 0.12);
  color: #165e5e;
  font-size: 12px;
  font-weight: 700;
}

.launcher-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.launch-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(31, 27, 22, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.launcher-actions {
  display: grid;
  gap: 10px;
  align-items: start;
}

.launcher-actions .btn {
  justify-self: start;
}

.launcher-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel-container {
  display: grid;
}

.panel {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.panel.hidden {
  display: none;
}

.mic-controls {
  display: grid;
  gap: 14px;
}

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

.transport-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 22, 0.12);
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 20px rgba(31, 27, 22, 0.12);
}

.transport-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.transport-start {
  background: linear-gradient(135deg, #ffffff 0%, #f3f7f6 55%, #e9f7f2 100%);
  color: #0f3d3d;
}

.transport-start .transport-icon {
  color: #e3543a;
  font-size: 18px;
}

.transport-stop {
  background: linear-gradient(135deg, #fff 0%, #f8eceb 60%, #fde6e3 100%);
  color: #5a1c16;
}

.stop-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e23d28;
  box-shadow: 0 0 0 4px rgba(226, 61, 40, 0.18);
}

.transport-label {
  font-size: 13px;
}

.waveform {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 27, 22, 0.04);
  border: 1px solid rgba(31, 27, 22, 0.08);
  opacity: 0.2;
  transition: opacity 0.2s ease;
}

.waveform.recording {
  opacity: 1;
}

.wave-canvas {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background: #0c1012;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.mic-settings {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-indicator {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(28, 124, 124, 0.12);
  color: #165e5e;
  font-weight: 600;
}

.file-upload-area {
  position: relative;
  border: 1px dashed rgba(31, 27, 22, 0.2);
  border-radius: 16px;
  padding: 24px;
  background: #fffaf4;
  text-align: center;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.file-upload-area:hover {
  border-color: rgba(28, 124, 124, 0.5);
  box-shadow: 0 10px 20px rgba(31, 27, 22, 0.08);
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.upload-icon {
  font-size: 26px;
}

.upload-text {
  font-weight: 600;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-ghost {
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
  box-shadow: none;
}

.btn-ghost:disabled {
  opacity: 0.5;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-stop {
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent) 0%, #1a9e89 55%, var(--accent-2) 110%);
  color: #fff;
  box-shadow: 0 12px 20px rgba(28, 124, 124, 0.25);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
}

.loading {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(242, 139, 91, 0.12);
  color: #b4532a;
  font-weight: 600;
  animation: pulse 1.5s ease infinite;
}

.loading.active {
  display: flex;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(242, 139, 91, 0.3);
  border-top-color: #f28b5b;
  animation: spin 0.8s linear infinite;
}

.result-section {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(31, 27, 22, 0.08);
}

.result-section.active {
  display: block;
}

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

.result-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.score-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.playback-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #fffaf4;
  border: 1px solid rgba(31, 27, 22, 0.08);
  margin-bottom: 16px;
}

.playback-controls {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.playback-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(28, 124, 124, 0.5);
  background: #fff;
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
}

.playback-btn:disabled,
.playback-download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.playback-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.playback-time {
  font-size: 12px;
  color: var(--muted);
}

.playback-download {
  border: none;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 16px;
  color: var(--accent);
  cursor: pointer;
}

.playback-panel audio {
  display: none;
}

.result-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.errors-panel {
  background: #fffaf4;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  display: grid;
  gap: 10px;
}

.error-toggle-list {
  display: grid;
  gap: 8px;
}

.error-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 27, 22, 0.08);
}

.error-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.error-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
}

.error-mispronunciation { background: #f4b400; }
.error-omission { background: #8c8c8c; }
.error-insertion { background: #d93025; }
.error-unexpected { background: #f6b1b6; color: #4a1a1d; }
.error-missing { background: #6f7b86; }
.error-monotone { background: #7b2cbf; }

.switch.switch-compact .slider {
  width: 34px;
  height: 20px;
}

.switch.switch-compact .slider::before {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
}

.switch.switch-compact input:checked + .slider::before {
  transform: translateX(14px);
}

.score-item {
  background: #fffaf4;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(242, 139, 91, 0.18);
}

.score-label {
  font-size: 13px;
  color: var(--muted);
}

.score-value {
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0;
}

.score-bar {
  width: 100%;
  height: 6px;
  background: rgba(31, 27, 22, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.word-details {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.words-title {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.words-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 6px;
  line-height: 1.8;
  padding: 16px;
  border-radius: 16px;
  background: #fffaf3;
  border: 1px dashed rgba(31, 27, 22, 0.15);
}

.word-chip {
  position: relative;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.word-chip.error-muted {
  color: var(--ink) !important;
  background: transparent !important;
  text-decoration: none !important;
}

.word-chip.error-mispronunciation {
  background: rgba(244, 180, 0, 0.2);
}

.word-chip.error-omission {
  background: rgba(140, 140, 140, 0.2);
  text-decoration: line-through;
}

.word-chip.error-insertion {
  background: rgba(217, 48, 37, 0.15);
}

.word-chip.error-unexpected {
  background: rgba(246, 177, 182, 0.3);
}

.word-chip.error-missing {
  background: rgba(111, 123, 134, 0.25);
}

.word-chip.error-monotone {
  background: rgba(123, 44, 191, 0.2);
}

.word-chip.has-error {
  background: rgba(239, 68, 68, 0.08);
}

.word-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 27, 22, 0.12);
}

.word-text-inline {
  display: inline-block;
}

.word-accuracy {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.word-details.show-accuracy .word-accuracy {
  display: block;
}

.word-tooltip {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translate(-50%, -100%);
  background: #fffaf3;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
  max-width: 320px;
  min-width: 220px;
  box-shadow: 0 12px 26px rgba(31, 27, 22, 0.18);
  border: 1px solid rgba(31, 27, 22, 0.08);
}

.tooltip-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tooltip-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(31, 27, 22, 0.15);
}

.tooltip-section-title {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
}

.tooltip-key {
  color: var(--muted);
}

.tooltip-value {
  font-weight: 600;
  text-align: right;
}

.phoneme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.phoneme-chip {
  background: rgba(242, 139, 91, 0.05);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid rgba(242, 139, 91, 0.15);
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}

.phoneme-score {
  display: block;
  font-weight: 700;
}

/* removed verbose raw-json tooltip block for student/teacher UX */

.word-chip:hover .word-tooltip {
  opacity: 1;
  transform: translate(-50%, -120%);
}

.word-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #fffaf3 transparent transparent transparent;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--muted);
}

.switch input {
  display: none;
}

.slider {
  width: 46px;
  height: 26px;
  background: rgba(31, 27, 22, 0.18);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(31, 27, 22, 0.2);
}

.switch input:checked + .slider {
  background: rgba(28, 124, 124, 0.7);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 13px;
}

.error {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  font-weight: 600;
}

.error.active {
  display: block;
}

.empty-state {
  color: #a16a4f;
  background: rgba(246, 196, 83, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(242, 139, 91, 0.2);
  }
  50% {
    box-shadow: 0 0 18px rgba(242, 139, 91, 0.25);
  }
}


@media (max-width: 720px) {
  body {
    padding: 20px 16px 36px;
  }

  .header {
    padding: 20px;
  }

  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header h1 {
    font-size: 26px;
  }

  .header-tips span {
    font-size: 11px;
  }

  .section {
    padding: 18px;
  }

  .title-row {
    gap: 12px;
  }

  .title-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .mode-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .launcher-copy h2 {
    font-size: 24px;
  }

  .launcher-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .mode-btn {
    flex: 1;
    justify-content: center;
  }

  .mic-settings {
    flex-direction: column;
    align-items: flex-start;
  }

  .transport-controls {
    grid-template-columns: 1fr;
  }

  .wave-canvas {
    height: 92px;
  }

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

  .result-extras {
    grid-template-columns: 1fr;
  }

  .playback-controls {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .playback-time {
    grid-column: 1 / -1;
  }

  .playback-download {
    grid-column: 2;
    justify-self: end;
  }

}

/* 时间轴样式 */
.timeline-panel {
  background: #fffaf6;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  margin-top: 16px;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#timelineCanvas {
  width: 100%;
  height: 180px;
  background: #0c1012;
  border-radius: 12px;
  cursor: pointer;
}

.timeline-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: rgba(31, 27, 22, 0.04);
  border-radius: 12px;
  font-size: 12px;
}

/* 评分趋势图样式 */
.trend-panel {
  background: #fffaf6;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  margin-top: 16px;
}

.trend-container {
  width: 100%;
}

#trendCanvas {
  width: 100%;
  height: 200px;
  background: #0c1012;
  border-radius: 12px;
}

/* 音节样式 */
.syllable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.syllable-chip {
  background: rgba(242, 139, 91, 0.05);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(242, 139, 91, 0.15);
  white-space: nowrap;
}

/* 音素错误标记 */
.phoneme-error {
  border-color: rgba(244, 180, 0, 0.5) !important;
  background: rgba(244, 180, 0, 0.1) !important;
}

/* 发音按钮样式 */
.pronunciation-btn {
  background: rgba(28, 124, 124, 0.15);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.pronunciation-btn:hover {
  background: rgba(28, 124, 124, 0.3);
  transform: scale(1.1);
}

/* 面板标题通用样式 */
.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}

/* ==================== Prosody 面板样式 ==================== */
.prosody-panel {
  background: #fffaf6;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  margin-top: 16px;
}

/* Prosody 评分部分 */
.prosody-score-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(242, 139, 91, 0.15);
}

.prosody-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.prosody-score-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.prosody-score-value {
  font-size: 24px;
  font-weight: 700;
}

.prosody-score-bar {
  height: 8px;
  background: #f0e8dd;
  border-radius: 4px;
  overflow: hidden;
}

.prosody-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Prosody 详细指标 */
.prosody-metrics-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.prosody-metric-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(31, 27, 22, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prosody-metric-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-icon {
  font-size: 16px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
}

/* Prosody 问题列表 */
.prosody-issues-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(244, 108, 108, 0.2);
}

.prosody-issues-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(31, 27, 22, 0.08);
}

.prosody-issue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31, 27, 22, 0.06);
}

.prosody-issue-item:last-child {
  border-bottom: none;
}

.issue-word {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.issue-index {
  color: var(--muted);
  font-size: 13px;
}

.issue-text {
  font-size: 15px;
}

.issue-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prosody-issue-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 无问题提示 */
.prosody-no-issues {
  text-align: center;
  padding: 24px;
  background: rgba(103, 194, 58, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(103, 194, 58, 0.3);
}

.no-issues-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.no-issues-text {
  font-size: 14px;
  color: #67c23a;
  font-weight: 600;
}

/* 调试信息 */
.prosody-debug-section {
  margin-top: 12px;
}

.prosody-debug-section details {
  background: #0c1012;
  border-radius: 8px;
  overflow: hidden;
}

.prosody-debug-section summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
  transition: background 0.2s ease;
}

.prosody-debug-section summary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.prosody-debug-section summary::-webkit-details-marker {
  display: none;
}

.prosody-debug-json {
  margin: 0;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.word-runner-section {
  display: none;
  background:
    radial-gradient(circle at top right, rgba(246, 196, 83, 0.2), transparent 32%),
    linear-gradient(145deg, #142226 0%, #10191c 48%, #1a262b 100%);
  color: #f7f4ee;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.word-runner-section.active {
  display: block;
}

.word-runner-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.word-runner-copy h2 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.word-runner-copy p {
  margin: 0;
  max-width: 620px;
  color: rgba(247, 244, 238, 0.74);
  line-height: 1.6;
}

.word-runner-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #172124;
  background: #f6c453;
}

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

.word-runner-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #f7f4ee;
}

.word-runner-board {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.word-runner-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.runner-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.runner-stat-label {
  font-size: 12px;
  color: rgba(247, 244, 238, 0.7);
}

.runner-stat-value {
  font-size: 22px;
  font-weight: 700;
}

.runner-hearts {
  color: #ff8f6b;
}

.word-runner-prompt-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.runner-prompt-label {
  font-size: 12px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.62);
}

.runner-prompt-word {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  line-height: 0.95;
}

.runner-prompt-hint {
  margin-top: 10px;
  color: rgba(247, 244, 238, 0.72);
  line-height: 1.6;
}

.runner-listen-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: #f6c453;
  color: #172124;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.runner-listen-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.word-runner-track-wrap {
  padding: 18px;
  border-radius: 20px;
  background: rgba(6, 11, 13, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.word-runner-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
}

.runner-stage {
  position: relative;
  padding: 16px 14px 18px;
  border-radius: 18px;
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.runner-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.runner-stage-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.runner-stage-word {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
  word-break: break-word;
}

.runner-stage-hole {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(3, 5, 7, 0.85);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.45);
}

.runner-stage.current {
  background: rgba(246, 196, 83, 0.16);
  border-color: rgba(246, 196, 83, 0.42);
  transform: translateY(-2px);
}

.runner-stage.current .runner-stage-badge {
  background: #f6c453;
  color: #172124;
}

.runner-stage.passed {
  background: rgba(38, 230, 162, 0.15);
  border-color: rgba(38, 230, 162, 0.35);
}

.runner-stage.passed .runner-stage-badge {
  background: #26e6a2;
  color: #102125;
}

.runner-stage.passed .runner-stage-hole {
  background: rgba(38, 230, 162, 0.2);
  box-shadow: inset 0 0 0 1px rgba(38, 230, 162, 0.35);
}

.runner-stage.failed {
  border-color: rgba(255, 143, 107, 0.45);
}

.runner-empty {
  padding: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.runner-empty-title {
  font-size: 18px;
  font-weight: 700;
}

.runner-empty-copy {
  margin-top: 8px;
  color: rgba(247, 244, 238, 0.68);
}

.word-runner-feedback {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  line-height: 1.6;
}

.word-runner-feedback[data-state="pass"] {
  background: rgba(38, 230, 162, 0.14);
  border-color: rgba(38, 230, 162, 0.24);
}

.word-runner-feedback[data-state="fail"] {
  background: rgba(255, 143, 107, 0.14);
  border-color: rgba(255, 143, 107, 0.24);
}

.word-runner-feedback[data-state="warn"] {
  background: rgba(246, 196, 83, 0.14);
  border-color: rgba(246, 196, 83, 0.24);
}

.word-runner-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.runner-history-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.runner-history-item.pass {
  border-color: rgba(38, 230, 162, 0.24);
}

.runner-history-item.fail {
  border-color: rgba(255, 143, 107, 0.24);
}

.runner-history-word {
  font-size: 16px;
  font-weight: 700;
}

.runner-history-meta {
  margin-top: 6px;
  color: rgba(247, 244, 238, 0.68);
  font-size: 13px;
}

@media (max-width: 720px) {
  .header-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .header-link {
    justify-content: center;
  }

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

  .entry-card {
    padding: 20px;
  }

  .experience-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .word-runner-topbar,
  .word-runner-prompt-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .word-runner-actions,
  .word-runner-actions .btn {
    width: 100%;
  }

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

  .runner-prompt-word {
    font-size: 38px;
  }

  .runner-listen-btn {
    width: 100%;
    justify-content: center;
  }
}
