/*
 * Mealingo 全局样式表
 * 共享页面: today / index / listening / matching / speaking / demos
 *
 * 目录:
 *   1.  CSS 变量 (:root)
 *   2.  Matching 页
 *   3.  基础重置 / 布局壳 / 侧边栏
 *   4.  品牌栏 / 主内容区
 *   5.  工作流 / 表单 / 按钮
 *   6.  Today 页
 *   7.  题目/作答/播放器
 *   8.  弹窗体系
 *   9.  语料库 / 表达管理
 *  10.  Listening 页
 *  11.  Speaking 页
 *  12.  答题共创弹窗
 */

:root {
  --page: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f2f2ee;
  --surface-soft-rgb: 242, 242, 238;
  --line: #deded7;
  --line-light: #e8e8e0;
  --line-dark: #cfcfc8;
  --text: #101010;
  --muted: #6f6f68;
  --muted-light: #c9c9bf;
  --muted-orange: #ff6a3d;
  --extra-muted: #9a9a93;
  --primary: #111111;
  --primary-strong: #000000;
  --primary-soft: #eeeeea;
  --success: #2f6f52;
  --success-dark: #235f45;
  --success-light: #86c6a7;
  --success-bg: #edf8f2;
  --success-tint: #e7f7ef;
  --success-accent: #2f9d63;
  --success-text: #0f6b46;
  --warning: #9b6a00;
  --warning-bg: #fff7dc;
  --warning-light: #f0d17a;
  --warning-text: #7a5300;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --danger-light: #efaaa3;
  --highlight: #ffd15c;
  --highlight-bg: #fff7d8;
  --highlight-border: #e4e4dd;
  --orange-start: #ff9b52;
  --online: #17a34a;
  --disabled: #b2b2b2;
  --divider: #dedede;
  --track: #c5c5c2;
  --sidebar-bg: #1f1f1f;
  --sidebar-bg-lighter: #202020;
  --sidebar-bg-dark: #0c0c0c;
  --shimmer-from: #ecece6;
  --shimmer-to: #f8f8f5;
  --shadow: none;
}

.matching-page-body {
  min-height: 100vh;
  background: var(--page);
}

.matching-page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.app-shell .matching-page {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 52px);
}

.matching-shell {
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  animation: matchingShellEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.matching-head,
.matching-actions,
.matching-audio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.matching-head h1,
.matching-panel h2 {
  margin: 0;
}

.matching-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.matching-progress {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--text);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

/* 匹配题已完成胶囊 */
.matching-done-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.matching-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--surface);
  background: var(--success);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 111, 82, 0.32);
  animation: matchingDonePop 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  white-space: nowrap;
}

.matching-done-badge:hover,
.matching-done-badge:focus-visible {
  background: var(--success-dark);
  outline: none;
  transform: translateY(-1px);
}

.matching-done-badge svg {
  width: 14px;
  height: 14px;
}

@keyframes matchingDonePop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.matching-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  align-items: start;
  gap: 16px;
  margin-top: 20px;
}

.matching-panel {
  padding: 0;
  background: transparent;
}

.matching-audio-list,
.matching-meaning-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.matching-audio-list {
  grid-template-columns: 1fr;
  width: min(100%, 280px);
  justify-self: center;
  padding: 0;
  background: transparent;
}

.matching-meaning-list {
  grid-template-columns: 1fr;
}

.matching-meaning-card,
.matching-dropzone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.matching-audio-card {
  display: grid;
  min-height: 74px;
  place-items: center;
  padding: 0;
  background: transparent;
}

.matching-audio-top {
  display: flex;
  gap: 0;
  justify-content: center;
  justify-items: center;
}

.matching-play {
  display: inline-flex;
  width: 210px;
  height: 58px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 22px 0 20px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: grab;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.matching-play:hover {
  border-color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

.matching-play:active {
  transform: translateY(0) scale(0.98);
  cursor: grabbing;
}

.matching-letter {
  display: inline-grid;
  min-width: 86px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--text);
  background: var(--surface);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.matching-audio-letter {
  min-width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-size: 20px;
  cursor: grab;
}

.matching-play .matching-audio-letter:hover {
  box-shadow: none;
  transform: none;
}

.matching-letter:hover {
  border-color: var(--text);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

.matching-letter {
  cursor: grab;
}

.matching-selected-label {
  display: inline-grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.matching-letter.is-used {
  opacity: 0;
  pointer-events: none;
}

.matching-play.is-used {
  opacity: 0;
  pointer-events: none;
}

.matching-letter-tray {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--surface);
}

.matching-letter-tray .matching-letter {
  justify-self: center;
}

.matching-play-icon {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid currentColor;
}

.matching-play-divider {
  width: 2px;
  height: 38px;
  border-radius: 999px;
  background: currentColor;
}

.matching-play-wave {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
}

.matching-play-wave i {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.matching-play-wave i:nth-child(1),
.matching-play-wave i:nth-child(9) {
  height: 12px;
}

.matching-play-wave i:nth-child(2),
.matching-play-wave i:nth-child(8) {
  height: 20px;
}

.matching-play-wave i:nth-child(3),
.matching-play-wave i:nth-child(7) {
  height: 25px;
}

.matching-play-wave i:nth-child(4),
.matching-play-wave i:nth-child(6) {
  height: 20px;
}

.matching-play-wave i:nth-child(5) {
  height: 32px;
}

.matching-play.is-playing .matching-play-wave i {
  animation: matchingWavePulse 620ms ease-in-out infinite;
}

.matching-play.is-playing .matching-play-wave i:nth-child(2) {
  animation-delay: 70ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(3) {
  animation-delay: 140ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(4) {
  animation-delay: 210ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(5) {
  animation-delay: 280ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(6) {
  animation-delay: 350ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(7) {
  animation-delay: 420ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(8) {
  animation-delay: 490ms;
}

.matching-play.is-playing .matching-play-wave i:nth-child(9) {
  animation-delay: 560ms;
}

@keyframes matchingWavePulse {
  0%,
  100% {
    transform: scaleY(0.55);
  }

  50% {
    transform: scaleY(1.18);
  }
}

.matching-meaning-card {
  display: grid;
  gap: 0;
  position: relative;
  min-height: 74px;
  padding: 14px 58px 14px 18px;
  align-content: center;
  justify-items: start;
  background: var(--surface-soft);
}

.matching-meaning-top {
  display: block;
}

.matching-meaning-card p {
  margin: 0;
  font-weight: 800;
  line-height: 1.45;
  min-width: 0;
  text-align: left;
}

.matching-selection {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
}

.matching-clear {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--surface);
  background: var(--success);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.matching-dropzone {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.matching-meaning-card.is-selected {
  border-color: var(--success-accent);
  background: var(--success-tint);
}

.matching-meaning-card.is-selected .matching-dropzone {
  background: transparent;
}

.matching-meaning-card.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.matching-meaning-card.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.matching-actions {
  margin-top: 18px;
}

.matching-feedback {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.matching-feedback.is-correct {
  color: var(--success);
}

.matching-feedback.is-warning {
  color: var(--warning);
}

.matching-page .matching-head,
.matching-page .matching-audio-card,
.matching-page .matching-letter-tray,
.matching-page .matching-meaning-card,
.matching-page .matching-actions {
  animation: matchingItemEnter 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.matching-page .matching-head {
  animation-delay: 40ms;
}

.matching-page .matching-audio-card:nth-child(1) {
  animation-delay: 110ms;
}

.matching-page .matching-audio-card:nth-child(2) {
  animation-delay: 150ms;
}

.matching-page .matching-audio-card:nth-child(3) {
  animation-delay: 190ms;
}

.matching-page .matching-audio-card:nth-child(4) {
  animation-delay: 230ms;
}

.matching-page .matching-letter-tray {
  animation-delay: 270ms;
}

.matching-page .matching-meaning-card:nth-child(1) {
  animation-delay: 320ms;
}

.matching-page .matching-meaning-card:nth-child(2) {
  animation-delay: 360ms;
}

.matching-page .matching-meaning-card:nth-child(3) {
  animation-delay: 400ms;
}

.matching-page .matching-meaning-card:nth-child(4) {
  animation-delay: 440ms;
}

.matching-page .matching-actions {
  animation-delay: 480ms;
}

.matching-page .is-matching-switching {
  animation: matchingQuestionSwitch 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.matching-page .matching-head.is-matching-switching {
  animation-delay: 0ms;
}

.matching-page .matching-audio-card.is-matching-switching:nth-child(1) {
  animation-delay: 55ms;
}

.matching-page .matching-audio-card.is-matching-switching:nth-child(2) {
  animation-delay: 90ms;
}

.matching-page .matching-audio-card.is-matching-switching:nth-child(3) {
  animation-delay: 125ms;
}

.matching-page .matching-audio-card.is-matching-switching:nth-child(4) {
  animation-delay: 160ms;
}

.matching-page .matching-letter-tray.is-matching-switching {
  animation-delay: 195ms;
}

.matching-page .matching-meaning-card.is-matching-switching:nth-child(1) {
  animation-delay: 235ms;
}

.matching-page .matching-meaning-card.is-matching-switching:nth-child(2) {
  animation-delay: 270ms;
}

.matching-page .matching-meaning-card.is-matching-switching:nth-child(3) {
  animation-delay: 305ms;
}

.matching-page .matching-meaning-card.is-matching-switching:nth-child(4) {
  animation-delay: 340ms;
}

.matching-page .matching-actions.is-matching-switching {
  animation-delay: 375ms;
}

@keyframes matchingShellEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes matchingItemEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes matchingQuestionSwitch {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .matching-page .matching-shell,
  .matching-page .matching-head,
  .matching-page .matching-audio-card,
  .matching-page .matching-letter-tray,
  .matching-page .matching-meaning-card,
  .matching-page .matching-actions,
  .matching-page .is-matching-switching {
    animation: none;
  }
}

@media (max-width: 720px) {
  .matching-shell {
    padding: 16px;
  }

  .matching-grid {
    grid-template-columns: 1fr;
  }

  .matching-audio-list,
  .matching-meaning-list {
    grid-template-columns: 1fr;
  }

  .matching-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page);
  font-family: "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-left: 61px;
  background: var(--page);
  transition: padding-left 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-shell:has(.sidebar.expanded) {
  padding-left: 421px;
}

.app-shell:has(.sidebar.account-expanded) {
  padding-left: 61px;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  width: 61px;
  padding: 0;
  color: var(--surface);
  background: var(--primary-strong);
  border-right: 1px solid var(--primary);
  transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: visible;
}

.sidebar.expanded {
  width: 421px;
}

.sidebar.account-expanded {
  width: 61px;
}

.icon-rail {
  display: flex;
  width: 60px;
  flex: 0 0 60px;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 0 12px;
  border-right: 1px solid #262626;
}

.llm-node-switch {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 60;
}

.llm-node-switch[hidden] {
  display: none;
}

.llm-node-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 82px;
  padding: 8px 11px;
  border: 1px solid #deded7;
  border-radius: 999px;
  color: #4f4f4a;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.llm-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a4a49d;
}

.llm-node-trigger.is-healthy {
  border-color: #25a663;
  color: #fff;
  background: #25a663;
  box-shadow: 0 6px 20px rgba(37, 166, 99, 0.24);
}

.llm-node-trigger.is-healthy .llm-node-dot {
  background: #fff;
}

.llm-node-trigger.is-unhealthy {
  border-color: #d64545;
  color: #fff;
  background: #d64545;
  box-shadow: 0 6px 20px rgba(214, 69, 69, 0.24);
}

.llm-node-trigger.is-unhealthy .llm-node-dot {
  background: #fff;
}

.llm-node-status.is-healthy::before {
  background: #25a663;
}

.llm-node-chevron {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.llm-node-trigger[aria-expanded="true"] .llm-node-chevron {
  transform: translateY(2px) rotate(225deg);
}

.llm-node-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  padding: 8px;
  border: 1px solid #deded7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13);
}

.llm-node-panel[hidden] {
  display: none;
}

.llm-node-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1px 3px 4px 7px;
}

.llm-node-panel-title {
  margin: 0;
  color: #777770;
  font-size: 11px;
  font-weight: 650;
}

.llm-node-refresh {
  width: 25px;
  height: 25px;
  padding: 5px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #777770;
  background: transparent;
  cursor: pointer;
}

.llm-node-refresh:hover {
  color: #363632;
  background: #f4f4ef;
}

.llm-node-refresh:focus-visible {
  outline: 2px solid #d64545;
  outline-offset: 1px;
}

.llm-node-refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

.llm-node-refresh svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.llm-node-refresh.is-refreshing svg {
  animation: llm-node-refresh-spin 700ms linear infinite;
}

@keyframes llm-node-refresh-spin {
  to { transform: rotate(360deg); }
}

.llm-node-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  color: #363632;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.llm-node-option:hover,
.llm-node-option.is-active {
  background: #f4f4ef;
}

.llm-node-option:disabled {
  cursor: not-allowed;
}

.llm-node-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #989891;
  font-size: 11px;
  font-weight: 600;
}

.llm-node-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b2b2ab;
  content: "";
}

.llm-node-status.is-healthy {
  color: #238d57;
}

.llm-node-status.is-unhealthy {
  color: #c93c3c;
}

.llm-node-status.is-unhealthy::before {
  background: #d64545;
}

.llm-node-toast {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 90;
  padding: 8px 14px;
  border-radius: 10px;
  color: #fff;
  background: rgba(32, 32, 30, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.llm-node-toast.is-visible {
  opacity: 1;
  transform: none;
}

.llm-node-toast.is-error {
  background: rgba(178, 62, 52, 0.95);
}

.rail-account-button {
  margin-top: auto;
}

.rail-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: #8f9fa1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-drawer {
  display: block;
  position: static;
  width: 0;
  max-width: none;
  min-width: 0;
  max-height: 100vh;
  overflow: hidden;
  padding: 16px 0;
  background: var(--page);
  opacity: 0;
  pointer-events: none;
  transition:
    width 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease;
}

.sidebar.expanded .sidebar-drawer {
  width: 360px;
  padding: 16px;
  opacity: 1;
  pointer-events: auto;
}

.sidebar.account-expanded .sidebar-drawer {
  position: absolute;
  left: 72px;
  bottom: 12px;
  width: 340px;
  max-height: none;
  overflow: visible;
  padding: 0;
  background: transparent;
}

.profile-button {
  display: flex;
  position: relative;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 0;
  color: var(--surface);
  background: transparent;
  cursor: pointer;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  background: var(--sidebar-bg);
}

.rail-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.rail-icon-account::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.rail-icon-account::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 3px;
  width: 16px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.rail-icon-learning::before,
.rail-icon-learning::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 9px;
  height: 16px;
  border: 2px solid currentColor;
  background: transparent;
}

.rail-icon-learning::before {
  left: 1px;
  border-radius: 5px 1px 1px 5px;
}

.rail-icon-learning::after {
  right: 1px;
  border-radius: 1px 5px 5px 1px;
}

.rail-tip {
  position: absolute;
  left: 54px;
  top: 2px;
  display: none;
  white-space: nowrap;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--surface);
  background: var(--sidebar-bg-lighter);
  font-weight: 800;
}

.profile-button:hover .rail-tip {
  display: block;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--primary);
  font-weight: 900;
}

.avatar-large {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  font-size: 22px;
}

.presence-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--online);
}

.profile-panel {
  position: static;
  z-index: 1;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
}

.profile-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.profile-panel-head strong,
.profile-panel-head span {
  display: block;
}

.profile-panel-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-panel-head strong {
  font-size: 20px;
}

.panel-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

.profile-stats div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
}

.profile-stats span,
.panel-section-title {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-stats strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.account-actions {
  margin: 18px 0 0;
  border-top: 1px solid #555;
  padding-top: 14px;
}

.sidebar.account-expanded .profile-panel {
  max-height: none;
  border: 1px solid #4a4a4a;
  border-radius: 24px;
  padding: 22px;
  color: #fff;
  background: #353535;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.sidebar.account-expanded .profile-panel-head span {
  color: #b8b8b8;
}

.sidebar.account-expanded .profile-panel-head .icon-button {
  border-color: transparent;
  color: #fff;
  background: transparent;
}

.sidebar.account-expanded .account-actions .button-ghost {
  justify-content: flex-start;
  border-radius: 10px;
  color: #fff;
  background: transparent;
  text-align: left;
}

.sidebar.account-expanded .account-actions .button-ghost:hover {
  background: #454545;
}

.today-profile-phrase-count {
  margin: 0 0 10px;
  border: 1px solid #b9ddc8;
  border-radius: 999px;
  padding: 7px 11px;
  color: #17663d;
  background: #edf9f2;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.learning-panel-head {
  padding-bottom: 2px;
}

.sidebar.learning-expanded .learning-panel {
  padding: 12px;
}

.sidebar.learning-expanded .profile-actions {
  gap: 7px;
  margin: 10px 0 6px;
}

.sidebar.learning-expanded .profile-actions .button-primary {
  min-height: 42px;
  padding-block: 8px;
}

.sidebar.learning-expanded .sidebar-task-settings-panel .tsm-head {
  padding: 10px 0 6px;
}

.sidebar.learning-expanded .tsm-body {
  gap: 9px;
  padding: 2px 12px 10px;
}

.sidebar.learning-expanded .tsm-row {
  gap: 4px;
}

.sidebar.learning-expanded .tsm-quota-input {
  height: 40px;
  padding-block: 5px;
}

.sidebar.learning-expanded .tsm-foot {
  padding: 10px 12px;
}

@media (max-height: 760px) {
  .sidebar.learning-expanded .sidebar-drawer {
    padding-block: 8px;
  }

  .sidebar.learning-expanded .learning-panel {
    max-height: calc(100vh - 16px);
    padding: 12px;
  }

  .sidebar.learning-expanded .profile-panel-head {
    min-height: 32px;
  }

  .sidebar.learning-expanded .profile-panel-head strong {
    font-size: 17px;
  }

  .sidebar.learning-expanded .profile-panel-head span {
    margin-top: 2px;
    font-size: 11px;
  }

  .sidebar.learning-expanded .profile-actions {
    gap: 6px;
    margin: 8px 0;
  }

  .sidebar.learning-expanded .profile-actions .button-primary {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 14px;
  }

  .sidebar.learning-expanded .sidebar-task-settings-panel .tsm-head {
    padding: 8px 0 5px;
  }

  .sidebar.learning-expanded .tsm-title-icon,
  .sidebar.learning-expanded .tsm-title-icon svg {
    width: 26px;
    height: 26px;
  }

  .sidebar.learning-expanded .tsm-head h2 {
    font-size: 16px;
  }

  .sidebar.learning-expanded .tsm-body {
    gap: 7px;
    padding: 2px 12px 8px;
  }

  .sidebar.learning-expanded .tsm-row {
    gap: 3px;
  }

  .sidebar.learning-expanded .tsm-module-label {
    font-size: 12px;
  }

  .sidebar.learning-expanded .tsm-quota-input {
    height: 34px;
    padding: 4px 10px;
    font-size: 14px;
  }

  .sidebar.learning-expanded .tsm-foot {
    padding: 8px 12px;
  }

  .sidebar.learning-expanded .tsm-save-hint {
    font-size: 10px;
  }

  .sidebar.learning-expanded .tsm-save-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-height: 620px) {
  .sidebar.learning-expanded .learning-panel-head span,
  .sidebar.learning-expanded .tsm-save-hint {
    display: none;
  }

  .sidebar.learning-expanded .profile-actions {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar.learning-expanded .sidebar-task-settings-panel .tsm-head {
    padding-top: 4px;
  }

  .sidebar.learning-expanded .tsm-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.main-shell {
  min-width: 0;
  background: var(--page);
  display: flex;
  flex-direction: column;
}

.main-shell > .today-page {
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 38px;
  line-height: 1.05;
  font-weight: 500;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 500;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 52px);
}

.app-brandbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.app-shell .app-brandbar {
  position: sticky;
  top: 0;
  z-index: 20;
  align-self: start;
  padding-block: 8px 12px;
  background: var(--page);
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  color: var(--surface);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, var(--sidebar-bg-lighter) 0%, var(--sidebar-bg-dark) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 32px rgba(17, 17, 17, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.04em;
  position: relative;
}

img.brand-logo {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.brand-logo::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange-start) 0%, var(--muted-orange) 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.app-brandbar strong,
.app-brandbar span {
  display: block;
}

.app-brandbar strong {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.app-brandbar span {
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted) 72%, var(--muted-orange) 28%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

.workflow {
  display: grid;
  gap: 18px;
  width: min(100%, 1120px);
  justify-self: center;
}

.workflow-step {
  animation: stepIn 220ms ease-out;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.metric,
.surface,
.question-box,
.output-box,
.corpus-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.surface {
  padding: clamp(24px, 2.4vw, 44px);
}

#questionStep.surface,
#answerStep.surface,
#speakingStep.surface,
#resultStep.surface {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

#questionStep {
  margin-bottom: 6px;
}

#answerStep {
  display: grid;
  gap: 10px;
}

#answerStep .section-head {
  margin-bottom: 0;
}

/* 长度提示放在“AI 帮我构思”按钮左侧，与按钮一起右对齐 */
#answerStep .section-head .answer-length-hint {
  margin-left: auto;
  margin-right: 10px;
  align-self: center;
  text-align: right;
}

#resultStep .section-head {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.question-play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--surface);
  background: var(--primary);
  cursor: pointer;
}

.question-play-button span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
}

.question-play-button .loading-spinner {
  width: 16px;
  height: 16px;
}

.form-row {
  display: grid;
  gap: 7px;
}

.form-row label,
.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--surface);
}

.control:focus,
.answer-box:focus {
  outline: 3px solid rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.control-small {
  min-width: 170px;
}

.button-primary,
.button-ghost,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.button-primary,
.button-ghost,
.button-danger,
.icon-button,
.text-button,
.profile-button,
.question-play-button,
.question-replay-button,
.stage-question-replay,
.stage-nav button,
.today-mini-button,
.keyword-add-button,
.keyword-icon-button,
.audio-play,
.audio-replay,
.audio-jump-group button,
.audio-speed select {
  transform-origin: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.button-primary:not(:disabled):hover,
.button-ghost:not(:disabled):hover,
.button-danger:not(:disabled):hover,
.icon-button:not(:disabled):hover,
.text-button:not(:disabled):hover,
.profile-button:not(:disabled):hover,
.question-play-button:not(:disabled):hover,
.question-replay-button:not(:disabled):hover,
.stage-question-replay:not(:disabled):hover,
.stage-nav button:not(:disabled):hover,
.today-mini-button:not(:disabled):hover,
.keyword-add-button:not(:disabled):hover,
.keyword-icon-button:not(:disabled):hover,
.audio-play:not(:disabled):hover,
.audio-replay:not(:disabled):hover,
.audio-jump-group button:not(:disabled):hover,
.audio-speed select:not(:disabled):hover,
.button-primary:not(:disabled):focus-visible,
.button-ghost:not(:disabled):focus-visible,
.button-danger:not(:disabled):focus-visible,
.icon-button:not(:disabled):focus-visible,
.text-button:not(:disabled):focus-visible,
.profile-button:not(:disabled):focus-visible,
.question-play-button:not(:disabled):focus-visible,
.question-replay-button:not(:disabled):focus-visible,
.stage-question-replay:not(:disabled):focus-visible,
.stage-nav button:not(:disabled):focus-visible,
.today-mini-button:not(:disabled):focus-visible,
.keyword-add-button:not(:disabled):focus-visible,
.keyword-icon-button:not(:disabled):focus-visible,
.audio-play:not(:disabled):focus-visible,
.audio-replay:not(:disabled):focus-visible,
.audio-jump-group button:not(:disabled):focus-visible,
.audio-speed select:not(:disabled):focus-visible {
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.14);
  transform: translateY(-1px) scale(1.04);
}

.button-primary:not(:disabled):active,
.button-ghost:not(:disabled):active,
.button-danger:not(:disabled):active,
.icon-button:not(:disabled):active,
.text-button:not(:disabled):active,
.profile-button:not(:disabled):active,
.question-play-button:not(:disabled):active,
.question-replay-button:not(:disabled):active,
.stage-question-replay:not(:disabled):active,
.stage-nav button:not(:disabled):active,
.today-mini-button:not(:disabled):active,
.keyword-add-button:not(:disabled):active,
.keyword-icon-button:not(:disabled):active,
.audio-play:not(:disabled):active,
.audio-replay:not(:disabled):active,
.audio-jump-group button:not(:disabled):active,
.audio-speed select:not(:disabled):active {
  box-shadow: 0 4px 10px rgba(17, 17, 17, 0.12);
  transform: translateY(0) scale(0.98);
}

.button-primary:focus-visible,
.button-ghost:focus-visible,
.button-danger:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.profile-button:focus-visible,
.question-play-button:focus-visible,
.question-replay-button:focus-visible,
.stage-question-replay:focus-visible,
.stage-nav button:focus-visible,
.today-mini-button:focus-visible,
.keyword-add-button:focus-visible,
.keyword-icon-button:focus-visible,
.audio-jump-group button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.button-primary {
  color: var(--surface);
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-strong);
}

.button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.button-primary.is-loading,
.button-ghost.is-loading,
.button-danger.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.modal-loading-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card.is-loading > :not(.modal-loading-panel) {
  opacity: 0.38;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-loading-card {
  display: grid;
  gap: 12px;
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  animation: modalLoadIn 220ms ease both;
}

.modal-loading-card .loading-spinner {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.loading-skeleton {
  display: grid;
  gap: 8px;
}

.loading-skeleton span {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--shimmer-from) 0%, var(--shimmer-to) 45%, var(--shimmer-from) 90%);
  background-size: 220% 100%;
  animation: skeletonSweep 1050ms ease-in-out infinite;
}

.loading-skeleton span:nth-child(2) {
  width: 74%;
}

.loading-skeleton span:nth-child(3) {
  width: 48%;
}

.button-ghost {
  color: var(--text);
  background: var(--surface-soft);
}

.button-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.question-box {
  min-height: auto;
  margin-top: 0;
  padding: 14px 16px;
  background: #ffffff;
}

.question-box-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.question-editor {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 0;
  resize: vertical;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 600;
}

.question-editor:focus {
  outline: none;
}

.question-box-inline .question-editor {
  grid-column: 1;
  grid-row: 1;
  min-height: 56px;
  padding-right: 0;
}

.question-box .question-translation {
  grid-column: 1;
  grid-row: 2;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.question-box-inline .question-play-group {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin-top: 0;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.question-helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.question-meta,
.tag-cloud,
.action-row,
.corpus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.question-box p {
  margin: 24px 0 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 500;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--text);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.tag.muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.tag-button {
  border: none;
  cursor: pointer;
  color: var(--muted);
  background: var(--surface-soft);
  transition: color 120ms ease, background 120ms ease;
}

.tag-button:hover {
  color: var(--text);
  background: var(--line);
}

.answer-box {
  width: 100%;
  min-height: 112px;
  margin-top: 8px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(16px, 1.6vw, 28px);
  padding-right: 52px; /* 给麦克风按钮留空间 */
  line-height: 1.7;
}

/* ---- 麦克风语音输入 ---- */
.answer-input-group {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.answer-input-group .answer-box {
  flex: 1;
}

.mic-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
  z-index: 2;
}

.mic-button:hover {
  color: var(--text);
  border-color: var(--line-dark);
  background: var(--surface-soft);
  transform: scale(1.06);
}

.mic-button:active {
  transform: scale(0.96);
}

.mic-button .mic-icon {
  width: 18px;
  height: 18px;
}

/* 录音中状态 */
.mic-button.is-recording {
  color: #fff;
  background: #e53e3e;
  border-color: #e53e3e;
  animation: mic-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.5);
}

.mic-button.is-recording:hover {
  background: #c53030;
  border-color: #c53030;
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
  }
}

.action-row {
  justify-content: space-between;
  margin-top: 12px;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
}

.today-panel {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: min(1120px, 100%);
  margin: 0 auto 8px;
  overflow-x: clip;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 24px 20px;
  background: var(--surface);
  transition:
    max-height 280ms ease,
    min-height 280ms ease,
    padding 220ms ease,
    border-radius 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
  animation: todayPanelEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.today-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.today-panel-head h2 {
  margin-bottom: 0;
}

.today-panel-title-row,
.today-panel-head > div:first-child {
  min-width: 0;
}

.today-panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.today-task-progress {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.today-task-progress.is-complete {
  color: var(--success-text);
  background: var(--success-tint);
}

.today-panel-head .section-subtitle {
  display: none;
}

.today-panel-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 0;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.today-panel-actions button {
  min-height: 38px;
  padding: 8px 10px;
}

.onboarding-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.5;
}

.onboarding-hint[hidden] {
  display: none;
}

.onboarding-hint-link {
  flex-shrink: 0;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.onboarding-hint-link:hover,
.onboarding-hint-link:focus-visible {
  text-decoration: underline;
}

.onboarding-hint-dismiss {
  display: grid;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  appearance: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.onboarding-hint-dismiss:hover,
.onboarding-hint-dismiss:focus-visible {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}

.onboarding-entry {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.onboarding-entry:hover,
.onboarding-entry:focus-visible {
  text-decoration: underline;
}

.onboarding-entry[hidden] {
  display: none;
}

.onboarding-dismiss-card {
  width: min(420px, 100%);
}

.onboarding-dismiss-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.onboarding-dismiss-actions {
  display: flex;
  margin-top: 20px;
  justify-content: flex-end;
  gap: 10px;
}

.today-question-list {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.today-question-list::-webkit-scrollbar {
  display: none;
}

.today-question-list.is-empty {
  display: flex;
}

.today-question-list .today-question-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 34px;
  white-space: nowrap;
}

.today-question-player-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.today-question-player-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.today-question-keywords {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.today-question-keyword-card,
.today-question-fold {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 10px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.today-question-keyword-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.today-question-keyword-value,
.today-question-fold-content {
  font-size: 15px;
  line-height: 1.55;
  font-weight: 800;
  color: var(--text);
  min-height: 20px;
}

.today-question-keyword-value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.today-question-keyword-value span {
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--page);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.today-question-keyword-value .is-empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.today-question-fold {
  overflow: hidden;
}

.today-question-fold summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
}

.today-question-fold summary::before {
  content: "\25B6";
  font-size: 10px;
  line-height: 1;
  transition: transform 160ms ease;
}

.today-question-fold[open] summary::before {
  transform: rotate(90deg);
}

.today-question-fold summary::-webkit-details-marker {
  display: none;
}

.today-question-fold-content {
  padding: 0;
  border-top: 0;
}

.today-panel-head {
  transition:
    opacity 180ms ease,
    transform 220ms ease;
  animation: todayItemEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 40ms;
}

.today-question-item {
  position: relative;
  z-index: 0;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 46px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
  scroll-snap-align: start;
  animation: todayItemEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  container-type: inline-size;
}

.today-question-item:nth-child(1) {
  animation-delay: 110ms;
}

.today-question-item:nth-child(2) {
  animation-delay: 150ms;
}

.today-question-item:nth-child(3) {
  animation-delay: 190ms;
}

.today-question-item:nth-child(4) {
  animation-delay: 230ms;
}

.today-question-player-panel .today-question-player-title,
.today-question-player-panel .audio-card,
.today-question-player-panel .today-question-keyword-card,
.today-question-player-panel .today-question-fold {
  animation: todayItemEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.today-question-player-panel .today-question-player-title {
  animation-delay: 80ms;
}

.today-question-player-panel .audio-card {
  animation-delay: 130ms;
}

.today-question-player-panel .today-question-keyword-card {
  animation-delay: 180ms;
}

.today-question-player-panel .today-question-fold:nth-of-type(1) {
  animation-delay: 220ms;
}

.today-question-player-panel .today-question-fold:nth-of-type(2) {
  animation-delay: 260ms;
}

.today-page .is-today-switching {
  animation: todayQuestionSwitch 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.today-panel-head.is-today-switching,
.today-question-player-title.is-today-switching {
  animation-delay: 0ms;
}

.today-question-item.is-today-switching:nth-child(1),
.today-question-player-panel .audio-card.is-today-switching {
  animation-delay: 55ms;
}

.today-question-item.is-today-switching:nth-child(2),
.today-question-player-panel .today-question-keyword-card.is-today-switching {
  animation-delay: 95ms;
}

.today-question-item.is-today-switching:nth-child(3),
.today-question-player-panel .today-question-fold.is-today-switching:nth-of-type(1) {
  animation-delay: 135ms;
}

.today-question-item.is-today-switching:nth-child(4),
.today-question-player-panel .today-question-fold.is-today-switching:nth-of-type(2) {
  animation-delay: 175ms;
}

@keyframes todayPanelEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes todayItemEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes todayQuestionSwitch {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.today-question-item:hover {
  background: var(--line);
  transform: translateY(-1px);
}

.today-question-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.today-question-item.active {
  color: var(--surface);
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(17, 17, 17, 0.12);
}

.today-question-item.answered {
  color: var(--success-text);
  background: var(--success-tint);
}

.today-question-item.answered:hover {
  background: var(--success-bg);
}

.today-question-item.answered.active {
  color: var(--surface);
  background: var(--success);
  box-shadow: 0 6px 14px rgba(47, 111, 82, 0.22);
}

.today-question-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.today-question-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.today-question-status.answered {
  color: var(--success-text);
  background: var(--success-tint);
}

.today-question-status.unanswered {
  color: var(--warning-text);
  background: var(--warning-bg);
}

/* 已存中文草稿、待 AI 补英文的中间态（AI 降级）：用中性/信息色区分于未回答 */
.today-question-status.draft {
  color: var(--info-text, #1d4ed8);
  background: var(--info-bg, rgba(59, 130, 246, 0.12));
}

.today-question-edit-modal {
  z-index: 74;
}

.today-question-edit-modal-card {
  width: min(640px, 100%);
  max-width: calc(100vw - 32px);
  padding: 28px;
  overflow: hidden;
}

.today-question-edit-modal-card > .section-head {
  align-items: center;
  flex-direction: row;
  margin-bottom: 24px;
}

.today-question-edit-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.today-question-edit-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.today-question-edit-input {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  padding: 15px 16px;
  color: var(--text);
  background: var(--surface);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.today-question-edit-input:hover {
  border-color: var(--muted-light);
}

.today-question-edit-input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.today-question-edit-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.today-question-edit-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.today-question-edit-actions .button-primary {
  min-width: 120px;
}

.today-page-body {
  min-height: 100vh;
  background: var(--page);
}

.today-page {
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 12px;
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 12px 0 24px;
}

.today-page-brandbar {
  width: 100%;
  justify-self: center;
  margin-bottom: 0;
}

.today-page .today-panel {
  margin-bottom: 0;
  padding: 14px 18px;
}

.today-page .today-panel-head {
  min-height: 38px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.today-page .today-panel-title-row {
  flex: 1 1 auto;
}

.today-page .today-panel-title-row h2 {
  flex: 0 0 auto;
  white-space: nowrap;
}

.today-page .today-question-list:not(.is-empty) {
  display: flex;
}

.today-page .today-question-item {
  flex: 0 0 auto;
  width: auto;
  min-width: 46px;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.today-page-question {
  width: 100%;
  max-width: min(1120px, 100%);
  justify-self: center;
}

.today-page-question > .section-head:empty {
  display: none;
}

.today-page #questionStep {
  min-height: 110px;
  margin-bottom: 0;
}

.today-page .question-box {
  min-height: 64px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.today-page .question-editor,
.today-page .question-box-inline .question-editor {
  height: 64px;
  min-height: 64px;
  padding: 2px 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  align-content: center;
}

.today-page .question-editor.is-empty-prompt {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.today-page .question-box-inline .question-play-group {
  gap: 10px;
}

.today-question-meta {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.today-question-meta[hidden] {
  display: none;
}

.today-question-meta-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 10px;
}

.today-page .today-question-meta .today-question-status {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 13px;
}

.today-page .today-question-meta .today-mini-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #d8d8d1;
  padding: 7px 12px;
  color: #343432;
  background: #f5f5f1;
  box-shadow: 0 2px 5px rgba(24, 24, 22, 0.07);
  font-size: 13px;
}

.today-page .today-question-meta .today-mini-button::before {
  content: "\270E";
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.today-page .today-question-meta .today-mini-button:not(:disabled):hover {
  border-color: #adada5;
  background: #ebebe6;
}

.today-page .today-question-meta .today-mini-button.danger {
  border-color: #f2c9c5;
  color: #b42318;
  background: #fff1ef;
  box-shadow: 0 2px 5px rgba(180, 35, 24, 0.07);
}

.today-page .today-question-meta .today-mini-button.danger::before {
  content: "\2715";
}

.today-page .today-question-meta .today-mini-button.danger:not(:disabled):hover {
  border-color: #e8a49e;
  background: #ffe5e2;
}

.today-page .today-page-question .question-play-button,
.today-page .today-page-question .question-replay-button {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

@media (min-width: 961px) {
  .today-page .today-panel-head {
    flex-wrap: nowrap;
  }

  .today-page .today-panel-title-row {
    flex-wrap: nowrap;
  }
}

.today-page #answerStep {
  gap: 7px;
}

.today-page #aiAnswerBtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid #c7c2ff;
  padding: 8px 13px 8px 10px;
  color: #4338ca;
  background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.12);
  white-space: nowrap;
}

.today-page #aiAnswerBtn::before {
  content: "\2726";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
  font-size: 13px;
  line-height: 1;
}

.today-page #aiAnswerBtn:not(:disabled):hover {
  border-color: #8b83f6;
  color: #3730a3;
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  box-shadow: 0 7px 18px rgba(79, 70, 229, 0.2);
}

.today-page #aiAnswerBtn:disabled {
  border-color: #dddbea;
  color: #858199;
  background: #f5f4f8;
  box-shadow: none;
}

.today-page .answer-box {
  min-height: 140px;
  font-size: 16px;
  margin-top: 0;
  padding-bottom: 72px;
  resize: none;
  overflow-y: hidden;
  transition: height 160ms ease;
}

/* 作答区之后的占位面板（口语训练等）隐藏时不留占位高度 */
.today-page .workflow-step[hidden] {
  display: none;
}

.today-page .answer-input-group > .action-row {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  margin: 0;
}

.today-page .answer-input-group > .today-page-status {
  position: absolute;
  left: auto;
  right: 58px; /* 给右下角麦克风按钮留位，避免状态文字遮挡 */
  bottom: 12px;
  z-index: 1;
  width: auto;
  max-width: calc(100% - 278px);
  margin: 0;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (min-width: 761px) {
  .today-page.has-player {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    grid-auto-rows: min-content;
    align-content: stretch;
    overflow: hidden;
  }

  .today-page.has-player #answerStep {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .today-page.has-player .answer-input-group {
    min-height: 0;
  }

  .today-page.has-player .answer-box {
    height: 100%;
    min-height: 0;
    resize: none;
    overflow-y: auto;
    transition: none;
  }

  .today-page.has-player .today-page-status {
    line-height: 1.3;
  }
}

@media (max-width: 960px) {
  .today-page .today-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .today-page .today-panel-title-row,
  .today-page .today-question-list {
    width: 100%;
    max-width: none;
  }

  .today-page .today-panel-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .today-page .question-editor.is-empty-prompt {
    white-space: normal;
  }
}

.today-page .today-question-player-panel {
  width: 100%;
  max-width: min(1120px, 100%);
  justify-self: center;
  align-self: start; /* 只占内容高度，避免作答区隐藏后弹性行把它拉伸出大片空白 */
  margin-top: 0;
}

.today-page-status {
  width: 100%;
  max-width: min(1120px, 100%);
  justify-self: center;
  margin: -4px 0 0;
}

.today-mini-button {
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.today-mini-button.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.output-box {
  min-height: clamp(180px, 28vh, 420px);
  margin-top: 12px;
  padding: clamp(14px, 1.5vw, 26px);
  line-height: 1.7;
  background: var(--surface-soft);
}

.muted {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.expression-table {
  border-collapse: collapse;
  background: var(--surface);
}

.expression-table th,
.expression-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.form-row-wide {
  grid-column: 1 / -1;
}

.text-control {
  min-height: 88px;
  resize: vertical;
}

.expression-manager {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 16px;
}

.expression-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface-soft);
}

.expression-toolbar h3,
.expression-toolbar p {
  margin-bottom: 0;
}

.expression-toolbar p {
  color: var(--muted);
  line-height: 1.6;
}

.expression-toolbar .button-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
}

.expression-toolbar-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.button-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}

.expression-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 160px;
  gap: 10px;
  min-width: min(560px, 100%);
}

.expression-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.expression-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.expression-col-select {
  width: 42px;
}

.expression-col-text {
  width: auto;
}

.expression-col-date {
  width: 58px;
}

.expression-col-count {
  width: 54px;
}

.expression-col-actions {
  width: 86px;
}

.expression-table th:nth-child(3),
.expression-table td:nth-child(3),
.expression-table th:nth-child(4),
.expression-table td:nth-child(4),
.expression-table th:nth-child(5),
.expression-table td:nth-child(5),
.expression-table th:nth-child(6),
.expression-table td:nth-child(6) {
  white-space: nowrap;
  padding-left: 3px;
  padding-right: 3px;
}

.expression-table th:nth-child(5),
.expression-table td:nth-child(5),
.expression-table th:nth-child(6),
.expression-table td:nth-child(6) {
  text-align: center;
}

.expression-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.expression-table td {
  color: var(--text);
  font-size: 13px;
  vertical-align: middle;
}

.expression-table td:nth-child(1) strong {
  font-size: 15px;
}

.expression-select-cell {
  text-align: center;
}

.expression-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.expression-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.expression-selected-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.expression-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.expression-actions .today-mini-button {
  min-height: 26px;
  padding: 4px 8px;
}

.expression-edit-modal {
  z-index: 90;
  background: rgba(0, 0, 0, 0.18);
}

.expression-edit-actions {
  justify-content: flex-end;
}

/* 导入表达弹窗 */

.corpus-import-profile-option {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.corpus-import-profile-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.corpus-import-profile-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.import-hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.import-hint code {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
}

.import-drop-zone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.import-drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.import-drop-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.import-drop-sub {
  font-size: 12px;
  color: var(--muted);
}

.import-preview {
  margin-top: 14px;
}

.import-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.import-preview-table th,
.import-preview-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.import-preview-table th {
  color: var(--muted);
  font-weight: 700;
}

.import-preview-table td:first-child {
  color: var(--muted);
  width: 40px;
}

.expression-table .card-number,
.review-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 26px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.expression-table .card-number {
  color: var(--surface);
  background: var(--primary);
}

.review-count {
  background: var(--surface-soft);
}

.expression-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.corpus-manager {
  display: block;
  min-height: 0;
}

.corpus-directory {
  background: var(--surface);
  padding: 16px;
}

.corpus-toolbar,
.corpus-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.corpus-toolbar h3,
.corpus-toolbar p,
.corpus-list-item p {
  margin-bottom: 0;
}

.corpus-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.corpus-toolbar-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.corpus-toolbar p,
.corpus-list-item p {
  color: var(--muted);
  line-height: 1.6;
}

.corpus-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.corpus-feature-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--surface);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.corpus-card-form {
  display: grid;
  gap: 10px;
  position: relative;
}

.corpus-card-form.editing {
  animation: editPulse 220ms ease-out;
}

.corpus-card-form.editing .stage-toolbar {
  align-items: flex-start;
}

.corpus-card-form.editing .stage-nav {
  flex-shrink: 0;
}

.corpus-feature-card:has(.corpus-card-form.editing) {
  border-color: var(--text);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.stage-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.stage-delete-btn {
  font-size: 13px;
  padding: 5px 12px;
}

.corpus-stage-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.corpus-stage-top.is-playable {
  cursor: pointer;
}

.corpus-stage-top.is-playable .stage-title-input {
  cursor: pointer;
}

.corpus-stage-top.is-playable:hover .stage-title-input {
  opacity: 0.86;
}

.question-play-group,
.stage-question-play-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.question-replay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 900;
  cursor: pointer;
}

.audio-card {
  background: #ffffff;
}

.audio-card .question-play-button,
.audio-card .question-replay-button {
  width: 40px;
  height: 40px;
}

.audio-card .question-play-button {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stage-question-replay,
.audio-replay {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--highlight-border);
}

.stage-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.stage-nav button {
  white-space: nowrap;
}

.editing-pill {
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--highlight);
  font-size: 12px;
  font-weight: 900;
}

.stage-title-input {
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.22;
  min-height: 0;
  resize: vertical;
}

.stage-title-input[readonly] {
  resize: none;
  overflow: hidden;
}

.stage-title-input:focus {
  outline: 0;
}

.corpus-card-form.editing .stage-title-input {
  border-radius: 12px;
  min-height: 56px;
  overflow: hidden;
  padding: 8px 10px;
  background: var(--highlight-bg);
  font-size: 20px;
  resize: none;
}

.stage-keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--highlight-border);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--page);
}

.stage-keyword-label {
  color: var(--muted);
  font-size: 0;
  font-weight: 900;
}

.stage-keyword-label::before {
  content: "\5173\952E\8BCD";
  font-size: 12px;
}

.stage-keyword-tags {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.corpus-card-form:not(.editing) .stage-keyword-tags {
  max-height: 84px;
  overflow: hidden;
  align-content: flex-start;
  scrollbar-width: none;
}

.corpus-card-form:not(.editing) .stage-keyword-tags::-webkit-scrollbar {
  display: none;
}

.stage-keyword-editor {
  position: relative;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  align-items: center;
}

.stage-keyword-editor-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.stage-keyword-editor-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding-right: 4px;
  cursor: pointer;
  transform-origin: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.stage-keyword-editor-row:hover,
.stage-keyword-editor-row:focus-visible {
  z-index: 1;
  border-color: var(--muted-light);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.12);
  transform: scale(1.06);
}

.stage-keyword-editor-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.stage-keyword-editor-row:hover .keyword-icon-button,
.stage-keyword-editor-row:focus-visible .keyword-icon-button {
  background: var(--danger-bg);
}

.keyword-add-button,
.keyword-icon-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.keyword-icon-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  color: var(--danger);
  font-size: 14px;
  background: transparent;
  box-shadow: none;
}

.modal-backdrop.keyword-modal-backdrop {
  z-index: 120;
  background: rgba(0, 0, 0, 0.18);
}

.keyword-modal-card {
  position: relative;
  z-index: 121;
  width: min(420px, 100%);
}

.stage-keyword-row .keyword-tag {
  min-height: 24px;
  padding: 3px 8px;
}

.stage-keyword-row .keyword-tag span {
  font-size: 11px;
}

.audio-controls {
  display: grid;
  grid-template-columns: 30px minmax(90px, 1fr) auto auto 30px auto auto minmax(80px, 112px);
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px;
  background: var(--surface-soft);
}

.audio-main-row,
.audio-sub-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.audio-sub-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(140px, 190px);
  justify-content: stretch;
}

.audio-play,
.audio-replay {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.audio-play {
  color: var(--surface);
  background: var(--primary);
  font-size: 14px;
}

.audio-replay {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 18px;
}

.audio-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.audio-message {
  min-width: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.audio-jump-group {
  display: flex;
  gap: 6px;
}

.audio-jump-group button,
.audio-speed select {
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.audio-progress,
.audio-volume input {
  width: 100%;
  accent-color: var(--primary);
}

.audio-speed,
.audio-volume {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audio-volume {
  display: grid;
  grid-template-columns: auto auto minmax(72px, 1fr);
  min-width: 0;
}

.audio-volume-icon {
  color: var(--text);
  font-size: 14px;
}

.audio-volume input {
  max-width: 120px;
}

.corpus-card-form [readonly] {
  cursor: default;
}

.corpus-card-form [readonly]:focus {
  outline: 0;
}

.corpus-card-form [readonly] {
  user-select: text;
}

.stage-content-scroll-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 10px;
  min-height: 0;
}

.stage-scroll-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.stage-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.stage-content-scroll {
  width: 8px;
  height: 100%;
  min-height: 120px;
  justify-self: center;
  margin: 0;
  padding: 0;
  appearance: auto;
  accent-color: var(--primary);
  cursor: ns-resize;
  writing-mode: vertical-lr;
  direction: ltr;
}

.stage-content-scroll[hidden] {
  display: none;
}

.stage-content-scroll-layout:has(.stage-content-scroll[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.corpus-card-overlay-panel .corpus-cards,
.corpus-card-overlay-panel .corpus-card-form,
.corpus-card-overlay-panel .stage-content-scroll-layout,
.corpus-card-overlay-panel .stage-scroll-content,
.corpus-card-overlay-panel .stage-answer-grid {
  min-height: 0;
}

.corpus-card-overlay-panel .corpus-cards {
  flex: 1;
}

.corpus-card-overlay-panel .corpus-card-form {
  height: 100%;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.corpus-card-overlay-panel .corpus-card-form.editing {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.corpus-card-overlay-panel .stage-content-scroll-layout,
.corpus-card-overlay-panel .stage-scroll-content {
  height: 100%;
}

.corpus-card-overlay-panel .stage-answer-grid,
.corpus-card-overlay-panel .stage-answer-panel,
.corpus-card-overlay-panel .stage-answer-field {
  height: 100%;
}

.corpus-card-overlay-panel .stage-answer-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.corpus-card-overlay-panel .stage-answer-panel textarea {
  height: auto;
  min-height: 0;
  overflow: hidden;
  resize: none;
  scrollbar-width: none;
}

.corpus-card-overlay-panel .stage-answer-panel textarea::-webkit-scrollbar {
  display: none;
}

.corpus-card-overlay-panel .stage-answer-field {
  grid-template-rows: minmax(0, 1fr);
}

.corpus-card-overlay-panel .stage-answer-field textarea {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  resize: none;
  scrollbar-width: none;
}

.corpus-card-overlay-panel .stage-answer-field textarea::-webkit-scrollbar {
  display: none;
}

.stage-divider {
  height: 7px;
  border-radius: 999px;
  background: var(--divider);
  transition: background 180ms ease;
}

.corpus-card-form.editing .stage-divider {
  background: linear-gradient(90deg, var(--primary), var(--highlight));
}

.stage-lane {
  display: grid;
  gap: 5px;
}

.stage-lane span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage-lane,
.stage-fold,
.stage-answer-panel,
.stage-answer-field {
  border-radius: 8px;
  padding: 10px 14px 12px;
  background: var(--disabled);
  border: 1px solid transparent;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.corpus-card-form.editing .stage-lane,
.corpus-card-form.editing .stage-fold,
.corpus-card-form.editing .stage-answer-field {
  border-color: var(--text);
  background: var(--track);
}

.corpus-card-form.editing .stage-lane:hover,
.corpus-card-form.editing .stage-fold:hover,
.corpus-card-form.editing .stage-answer-field:hover {
  z-index: 1;
  transform: scale(1.025);
}

.stage-lane textarea,
.stage-lane input,
.stage-fold textarea,
.stage-answer-panel textarea,
.stage-answer-field textarea {
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.stage-lane textarea,
.stage-fold textarea,
.stage-answer-panel textarea,
.stage-answer-field textarea {
  min-height: 56px;
  resize: vertical;
}

.stage-lane textarea:focus,
.stage-lane input:focus,
.stage-fold textarea:focus,
.stage-answer-panel textarea:focus,
.stage-answer-field textarea:focus {
  outline: 0;
}

.stage-answer-panel,
.stage-answer-panel * {
  cursor: pointer !important;
}

.stage-answer-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.stage-answer-panel.is-hidden {
  grid-template-rows: auto;
}

.stage-answer-panel.is-hidden .stage-answer-toggle {
  display: flex;
  justify-content: center;
  height: 100%;
  padding-bottom: 0;
  font-size: 20px;
  text-align: center;
}

.stage-answer-panel.is-hidden textarea {
  display: none;
}

.corpus-card-form.editing .stage-lane:focus-within,
.corpus-card-form.editing .stage-fold:focus-within,
.corpus-card-form.editing .stage-answer-field:focus-within {
  background: var(--track);
  transform: scale(1.025);
}

.stage-lane small {
  color: rgba(0, 0, 0, 0.62);
  font-size: 12px;
}

.stage-fold summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  text-align: left;
}

.stage-fold summary::before {
  content: "\25B6";
  font-size: 10px;
  line-height: 1;
  transition: transform 160ms ease;
}

.stage-fold[open] summary::before {
  transform: rotate(90deg);
}

.stage-fold summary::-webkit-details-marker {
  display: none;
}

.stage-fold.editing-open {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
}

.stage-fold.editing-open summary {
  display: flex;
  min-width: 0;
  min-height: 64px;
  justify-content: center;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.stage-fold textarea {
  margin-top: 6px;
}

.stage-fold.editing-open textarea {
  grid-column: 2;
  margin-top: 0;
}

.corpus-card-form.editing .stage-fold textarea {
  overflow: hidden;
  resize: none;
}

.stage-answer-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
}

.stage-answer-label {
  display: flex;
  min-width: 0;
  min-height: 64px;
  justify-content: center;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.stage-answer-field textarea {
  grid-column: 2;
  margin-top: 0;
}

/* 长度提示放在“AI 帮我构思”按钮左侧，与按钮一起右对齐 */
#answerStep .section-head .answer-length-hint {
  margin-left: auto;
  margin-right: 10px;
  align-self: center;
  text-align: right;
}

.answer-length-hint {
  grid-column: 2;
  min-height: 16px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.answer-length-hint-text {
  margin: 0;
}

.answer-length-hint-text:empty {
  margin: 0;
}

.answer-length-hint-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  cursor: pointer;
  user-select: none;
  color: inherit;
}

.answer-length-hint-action.is-hidden {
  display: none;
}

.answer-length-hint-action input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.answer-length-hint.is-ideal {
  color: var(--success-text);
}

.answer-length-hint.is-low {
  color: var(--muted);
}

.answer-length-hint.is-long {
  color: var(--warning-text);
}

.answer-length-hint.is-over {
  color: var(--danger);
}

.corpus-card-form.editing .stage-answer-field textarea {
  overflow: hidden;
  resize: none;
}

.today-question-edit-form .stage-answer-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 4px;
  align-items: start;
  border-color: var(--highlight-border);
  border-radius: 12px;
  padding: 8px 10px 10px;
  background: var(--page);
}

.today-question-edit-form .stage-answer-field:hover {
  transform: scale(1.025);
}

.today-question-edit-form .stage-answer-label {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
  min-width: 0;
  min-height: 64px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.today-question-edit-form .stage-answer-field textarea {
  grid-column: 2;
  min-height: 64px;
  border: 0;
  border-radius: 0;
  padding: 8px 6px;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  resize: none;
}

.today-question-edit-form .stage-answer-field textarea:focus {
  outline: 0;
}

.today-question-edit-form .stage-answer-field textarea::placeholder {
  color: var(--extra-muted);
  font-weight: 700;
}

.corpus-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.corpus-card-meta span {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
}

.corpus-card-meta .card-number {
  color: var(--surface);
  background: var(--primary);
}

.bilingual-block {
  margin-top: 12px;
}

.bilingual-block > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bilingual-block h4 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}

.bilingual-block p {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.corpus-feature-foot,
.corpus-list-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.corpus-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 语料库列表：表头固定、仅列表滚动 */
.corpus-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 60vh;
}

.corpus-list-header-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 160px 90px 110px;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
  /* 右侧预留 14px：与数据行 6px 滚动条占位 + 8px 滚动条宽度对齐 */
  padding: 4px 14px 10px;
  padding-right: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.corpus-list-sort {
  border: 0;
  padding: 4px 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.corpus-list-sort-date {
  text-align: right;
}

.corpus-list-sort:hover {
  color: var(--text);
}

.corpus-list-wrap .corpus-list {
  flex: 1;
  min-height: 0;
}

.corpus-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.corpus-list::-webkit-scrollbar {
  width: 8px;
}

.corpus-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line);
}

.corpus-list-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 160px 90px 110px;
  gap: 12px;
  align-items: center;
  position: relative;
  min-height: 64px;
  height: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.corpus-list-item:hover,
.corpus-list-item.selected {
  border-color: var(--text);
  background: var(--surface-soft);
}

.corpus-list-item .card-number {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  color: var(--surface);
  background: var(--primary);
}

.keyword-tag {
  gap: 6px;
}

.keyword-tag span + span {
  color: var(--muted);
  font-weight: 700;
}

.corpus-list-text,
.corpus-list-dates {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.corpus-list-status {
  justify-self: start;
  min-height: 24px;
  padding: 4px 10px;
  font-size: 13px;
}

.corpus-list-date {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.corpus-list-text strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-list-text span,
.corpus-list-dates span {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-list-header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 80px 90px auto;
  gap: 12px;
  padding: 4px 15px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.corpus-list-source:empty {
  display: none;
}

.corpus-list-source {
  justify-self: start;
  overflow: hidden;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作按钮悬浮显示，绝对定位避免占用表格列导致表头错位 */
.corpus-list-actions {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  padding-left: 12px;
  background: inherit;
  opacity: 0;
  transition: opacity 160ms ease;
}

.corpus-list-actions .today-mini-button {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 14px;
}

.corpus-list-item:hover .corpus-list-actions {
  opacity: 1;
}

.corpus-list-item .keyword-tag {
  min-height: 24px;
  padding: 3px 8px;
}

.corpus-list-item .keyword-tag span {
  font-size: 11px;
}

.corpus-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.profile-editor,
.corpus-editor {
  max-width: 1040px;
}

.corpus-editor {
  margin-top: 16px;
}

.profile-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface-soft);
}

.profile-editor-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-section-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.profile-section-actions .button-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

.profile-editor-head h3,
.profile-editor-head p {
  margin-bottom: 0;
}

.profile-onboarding-status {
  display: block;
  margin-top: 4px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 800;
}

.profile-onboarding-status[hidden] {
  display: none;
}

.profile-modal-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  align-items: start;
  min-height: 0;
}

.profile-form {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.profile-table-form {
  grid-template-columns: 1fr;
}

.profile-table {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.profile-fields-list {
  min-height: 0;
  overflow-y: auto;
}

.profile-table-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-top: 1px solid var(--line);
  min-height: 78px;
}

.profile-table-row:first-child {
  border-top: 0;
}

.profile-table-row.is-ai-profile-new {
  position: relative;
  z-index: 0;
  margin: 6px;
  border: 2px solid #36a269;
  border-radius: 16px;
  padding: 8px;
  background: #f0fbf5;
  box-shadow: 0 0 0 4px rgba(54, 162, 105, 0.12);
}

.profile-table-row.is-ai-profile-new:first-child {
  border-top: 2px solid #36a269;
}

.profile-table-head {
  min-height: 44px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.profile-table-row .control {
  min-height: 38px;
  border-radius: 12px;
}

.profile-field-delete {
  justify-self: end;
  min-height: 34px;
  padding: 7px 12px;
}

.profile-field-delete:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.56;
}

.profile-add-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.profile-form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.profile-form-actions .button-primary {
  justify-self: end;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  grid-column: 1 / -1;
}

.profile-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ai-generate-translation {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* AI 生成弹窗：以下选择器在 today.html / today.js 中使用但暂无样式，
   待设计补充（非本次清理范围）：
   .ai-generate-error / .ai-generate-hint / .ai-generate-list /
   .ai-generate-item / .ai-generate-text / .ai-generate-preview */
.ai-generate-error-text {
  margin: 0 0 12px;
  border: 1px solid var(--danger-light);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 13px;
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

/* ── 管理弹窗统一尺寸 ─────────────────────────────────── */

.modal-card-main {
  width: min(1000px, 100%);
  height: min(760px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card-main .section-head {
  flex-shrink: 0;
}

.answer-preview-modal-card {
  width: min(860px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  padding: 22px;
}

.answer-preview-modal-card .section-head {
  margin-bottom: 12px;
}

.answer-preview-content {
  display: grid;
  gap: 12px;
}

.answer-preview-original,
.answer-preview-keywords {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.answer-preview-original span,
.answer-preview-field > span,
.answer-preview-keywords-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.answer-preview-original p {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.answer-preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-preview-field {
  display: grid;
  gap: 6px;
}

/* 拆分卡片复用卡片播放器（corpus-card-form editing）结构，
   通过上一张/下一张一次展示一张卡片 */

.answer-preview-field textarea {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  resize: vertical;
}

.answer-preview-field textarea:focus,
.answer-preview-keyword input:focus {
  outline: 2px solid rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.answer-preview-keywords {
  display: grid;
  gap: 8px;
}

.answer-preview-keywords-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.answer-preview-keywords-head .button-ghost {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.answer-preview-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.answer-preview-keyword {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  background: var(--disabled);
}

.answer-preview-keyword input {
  width: 112px;
  min-width: 0;
  border: 0;
  padding: 2px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.answer-preview-keyword button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.answer-preview-keyword button:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.answer-preview-profile-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.answer-preview-profile-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.answer-preview-modal-card > .form-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 700px) {
  .answer-preview-fields {
    grid-template-columns: 1fr;
  }

  .answer-preview-modal-card {
    padding: 18px;
  }
}

/* 个人信息弹窗 */
#profileModal .modal-card-main {
  height: auto;
  max-height: calc(100vh - 32px);
}

#profileModal .modal-card-main .profile-modal-grid {
  overflow: hidden;
  min-height: 0;
}

#profileModal .profile-form,
#profileModal .profile-table {
  height: auto;
}

#profileModal .profile-form {
  gap: 8px;
}

#profileModal .profile-table-row {
  min-height: 58px;
  padding: 6px 10px;
}

#profileModal .profile-table-head {
  min-height: 36px;
  padding-block: 5px;
}

#profileModal .profile-table-row .control {
  min-height: 36px;
  padding-block: 7px;
}

#profileModal .profile-hint {
  line-height: 1.4;
  padding-inline: 2px;
}

#profileModal .profile-fields-list {
  max-height: min(360px, 42vh);
}

#profileModal .profile-table-row {
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr) 70px;
}

#profileModal .profile-editor-head,
#profileModal .profile-form-actions {
  flex-shrink: 0;
}

#profileModal .profile-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line-light);
  padding-top: 10px;
  background: var(--surface);
}

#profileModal .profile-add-row {
  flex: 1;
  min-width: 0;
}

#profileModal .profile-form-actions > .button-primary {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 22px;
}

/* 能力设置 / 目标设置弹窗：更长一些的卡片 + 带表头的紧凑表格 */
#abilityModal .modal-card-small,
#goalModal .modal-card-small {
  width: min(640px, 100%);
}

#abilityModal .profile-fields-list,
#goalModal .profile-fields-list {
  min-height: 240px;
  max-height: 52vh;
  overflow-y: auto;
}

#abilityModal .profile-table-row,
#goalModal .profile-table-row {
  min-height: 52px;
  padding: 6px 12px;
}

/* 表格内输入框去掉自身边框，避免看起来像多余的内嵌线 */
#abilityModal .profile-table-row:not(.profile-table-head) .control,
#goalModal .profile-table-row:not(.profile-table-head) .control {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
}

#abilityModal .profile-table-row:not(.profile-table-head) .control:hover,
#goalModal .profile-table-row:not(.profile-table-head) .control:hover {
  border-color: var(--line);
  background: var(--surface);
}

#abilityModal .profile-table-row:not(.profile-table-head) .control:focus,
#goalModal .profile-table-row:not(.profile-table-head) .control:focus {
  border-color: var(--primary);
  background: var(--surface);
}

#abilityModal .profile-table-head,
#goalModal .profile-table-head {
  min-height: 38px;
  padding-block: 4px;
}

.profile-table-empty {
  display: grid;
  place-items: center;
  min-height: 238px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

#profileModal .profile-form-actions .button-primary {
  justify-self: end;
  min-width: 112px;
}

/* 语料库管理弹窗 */
#corpusModal .modal-card-main .corpus-manager {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* 表达管理弹窗 */
#expressionModal .modal-card-main .expression-manager {
  flex: 1;
  min-height: 0;
}

/* 学习记录弹窗 */

.study-record-modal-card {
  width: min(860px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  overflow: hidden;
}

.daily-report-modal-card {
  width: min(620px, calc(100vw - 32px));
}

.daily-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-report-actions .button-ghost {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.daily-report-content {
  display: grid;
  gap: 18px;
}

.daily-report-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.daily-report-headline {
  margin: -10px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.daily-report-overview,
.daily-report-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.daily-report-overview > div,
.daily-report-module {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}

.daily-report-overview strong,
.daily-report-module strong,
.daily-report-module span,
.daily-report-module small {
  display: block;
}

.daily-report-overview strong {
  font-size: 24px;
  line-height: 1.1;
}

.daily-report-overview span,
.daily-report-module span,
.daily-report-module small,
.daily-report-note {
  color: var(--muted);
  font-size: 12px;
}

.daily-report-overview span {
  margin-top: 5px;
}

.daily-report-modules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-report-module {
  display: grid;
  gap: 5px;
  min-height: 96px;
  background: var(--surface);
}

.daily-report-module strong {
  font-size: 17px;
}

.daily-report-module.is-empty {
  opacity: .6;
}

.daily-report-note,
.daily-report-error {
  margin: 0;
  line-height: 1.6;
}

.daily-report-error {
  color: var(--danger);
  font-size: 13px;
}

.study-record-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.study-record-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.study-record-content,
.study-record-detail-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.study-record-detail-content {
  padding-right: 4px;
}

.study-record-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 28px 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  text-align: center;
}

.study-record-table .study-record-empty-row td,
.study-record-table .study-record-empty-row td:first-child {
  width: auto;
  max-width: none;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  white-space: normal;
  cursor: default;
}

.study-record-table tbody tr.study-record-empty-row:hover,
.study-record-table tbody tr.study-record-empty-row:focus-visible {
  background: transparent;
  outline: none;
}

.study-record-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.study-record-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.study-record-table th,
.study-record-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.study-record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.study-record-table .th-filter {
  position: relative;
  display: inline-flex;
}

.study-record-table th:has(.th-filter-btn[aria-expanded="true"]) {
  z-index: 2;
}

.study-record-table .th-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px;
  margin: -4px -8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.study-record-table .th-filter-btn:hover,
.study-record-table .th-filter-btn[aria-expanded="true"] {
  color: var(--text);
  background: rgba(17, 17, 17, .06);
}

.study-record-table .th-filter-btn.is-active {
  color: var(--text);
  font-weight: 700;
}

.study-record-table .th-filter-btn:focus-visible {
  outline: 2px solid rgba(17, 17, 17, .2);
  outline-offset: 1px;
}

.study-record-table .th-filter-arrow {
  font-size: 10px;
  line-height: 1;
}

.study-record-table .th-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 5;
  min-width: 112px;
  max-height: 220px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  list-style: none;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(17, 17, 17, .12);
  transform: translateX(-50%);
}

.study-record-table .th-filter-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.study-record-table .th-filter-option:hover,
.study-record-table .th-filter-option:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.study-record-table .th-filter-option.is-active {
  font-weight: 700;
  background: var(--surface-soft);
}

.study-record-table tbody tr {
  cursor: pointer;
  transition: background-color 150ms ease;
}

.study-record-table tbody tr:hover,
.study-record-table tbody tr:focus-visible {
  outline: none;
  background: var(--surface-soft);
}

.study-record-table tbody tr.is-error {
  color: var(--danger, #b42318);
  background: #fff1f0;
  box-shadow: inset 3px 0 0 var(--danger, #b42318);
}

.study-record-table tbody tr.is-error:hover,
.study-record-table tbody tr.is-error:focus-visible {
  background: #ffe8e6;
}

.study-record-table tbody tr:last-child td {
  border-bottom: 0;
}

.study-record-table th:first-child,
.study-record-table td:first-child {
  width: 52%;
  max-width: 0;
}

.study-record-table th:not(:first-child),
.study-record-table td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.study-record-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 500;
}

.study-record-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-record-title::after {
  content: "›";
  color: var(--muted);
  font-size: 18px;
}

.study-record-table tr.is-error .study-record-title,
.study-record-table tr.is-error .study-record-title::after {
  color: var(--danger, #b42318);
}

.study-record-tag {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
}

.study-record-tag.is-today { border-color: #b8d8c7; color: #2f6f52; background: #edf8f2; }
.study-record-tag.is-listening { border-color: #b9cee8; color: #315f8d; background: #edf5fc; }
.study-record-tag.is-matching { border-color: #ead394; color: #8a6200; background: #fff7dc; }
.study-record-tag.is-speaking { border-color: #d5c2e8; color: #75509a; background: #f7f0fc; }

.study-record-detail-backdrop {
  z-index: 90;
}

.speaking-phrase-detail-backdrop {
  z-index: 100;
}

.speaking-phrase-detail-heading {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.speaking-phrase-detail-heading > div {
  min-width: 0;
}

.speaking-phrase-detail-heading #speakingPhraseDetailLevel {
  flex-shrink: 0;
  margin-bottom: 2px;
  padding: 6px 14px;
  font-size: 14px;
}

.study-record-detail-card {
  width: min(820px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.study-record-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.study-record-detail-meta span,
.study-record-score span {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.study-record-detail-panel,
.study-record-match-list {
  display: grid;
  gap: 12px;
}

.study-record-question-preview,
.study-record-module-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.study-record-question-preview > strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  line-height: 1.55;
}

.study-record-detail-block,
.study-record-answer-grid section,
.study-record-match-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.study-record-detail-block.is-error {
  border-color: #efaaa3;
  background: #fff1f0;
}

.study-record-detail-block > p:last-child,
.study-record-answer-grid p {
  margin-bottom: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.study-record-detail-label,
.study-record-answer-grid span,
.study-record-match-row span {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.study-record-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.study-record-keywords > span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  background: var(--page);
}

.study-record-keywords small {
  color: var(--muted);
}

.study-record-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.study-record-answer-grid section {
  min-height: 96px;
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface-soft);
}

.study-record-answer-grid span {
  font-size: 12px;
  font-weight: 600;
}

.study-record-answer-grid p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.study-record-option-list,
.study-record-recordings,
.speaking-phrase-list {
  display: grid;
  gap: 9px;
}

.speaking-phrase-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.speaking-phrase-row:hover,
.speaking-phrase-row:focus-visible {
  outline: none;
  border-color: var(--text);
  background: var(--surface);
  transform: translateY(-1px);
}

.speaking-phrase-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.speaking-phrase-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaking-phrase-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speaking-phrase-result b {
  min-width: 58px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--success, #2f6f52);
  background: #edf8f2;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.speaking-phrase-result b.is-warning {
  color: #9b6a00;
  background: #fff7dc;
}

.speaking-phrase-result::after {
  content: "›";
  color: var(--muted);
  font-size: 20px;
}

.speaking-evaluation-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}

.speaking-evaluation-total {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  color: var(--success, #2f6f52);
  background: #edf8f2;
}

.speaking-evaluation-total strong {
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.speaking-evaluation-total strong.is-empty {
  font-size: 13px;
}

.speaking-evaluation-total .speaking-evaluation-stars {
  font-size: 14px;
  letter-spacing: -1px;
}

.speaking-evaluation-total small {
  font-size: 10px;
  font-weight: 700;
}

.speaking-evaluation-metrics {
  display: grid;
  gap: 9px;
}

.speaking-evaluation-metrics > div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.speaking-evaluation-metrics i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.speaking-evaluation-metrics i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success, #2f6f52);
}

.speaking-question-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: var(--surface-soft);
}

.speaking-question-en,
.speaking-question-zh {
  margin: 0;
  line-height: 1.5;
}

.speaking-question-en {
  font-size: 17px;
  font-weight: 800;
}

.speaking-question-zh {
  color: var(--muted);
  font-size: 13px;
}

.study-record-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.study-record-option > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--primary);
}

.study-record-option.is-correct { border-color: #86c6a7; background: #edf8f2; }
.study-record-option.is-correct > span { background: var(--success, #2f6f52); }
.study-record-option.is-wrong { border-color: #efaaa3; background: #fff1f0; }
.study-record-option.is-wrong > span { background: var(--danger, #b42318); }

.study-record-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface-soft);
}

.study-record-match-row.is-wrong {
  border-color: #efaaa3;
  background: #fff1f0;
}

.study-record-match-audio {
  display: inline-flex;
  width: 152px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.study-record-match-audio:hover,
.study-record-match-audio:focus-visible {
  outline: none;
  border-color: var(--text);
  transform: translateY(-1px);
}

.study-record-match-audio.is-playing {
  border-color: var(--primary);
  background: var(--surface);
}

.study-record-match-play {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.study-record-match-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.study-record-match-wave {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 3px;
}

.study-record-match-wave i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: currentColor;
}

.study-record-match-wave i:nth-child(1),
.study-record-match-wave i:nth-child(5) { height: 9px; }
.study-record-match-wave i:nth-child(2),
.study-record-match-wave i:nth-child(4) { height: 16px; }
.study-record-match-wave i:nth-child(3) { height: 23px; }

.study-record-match-audio.is-playing .study-record-match-wave i {
  animation: study-record-wave-pulse 620ms ease-in-out infinite alternate;
}

@keyframes study-record-wave-pulse {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1.12); }
}

.study-record-match-item {
  display: grid;
  flex: 0 0 auto;
  max-width: 240px;
  min-width: 0;
  gap: 6px;
  justify-items: start;
  align-content: center;
}

.study-record-match-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.study-record-match-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  flex: 1;
}

.study-record-match-answer {
  display: grid;
  min-width: 0;
  gap: 4px;
  align-content: start;
  padding: 2px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.study-record-match-answer + .study-record-match-answer {
  border-left: 1px solid var(--line);
}

.study-record-match-answer span {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
}

.study-record-match-answer strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.study-record-match-answer.is-correct strong {
  color: var(--success);
}

.study-record-match-row.is-wrong .study-record-match-answer.is-user strong {
  color: var(--danger, #b42318);
}

.study-record-audio,
.study-record-recordings button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.study-record-audio:hover,
.study-record-audio:focus-visible,
.study-record-recordings button:hover,
.study-record-recordings button:focus-visible {
  outline: none;
  border-color: var(--text);
  background: var(--surface);
  transform: translateY(-1px);
}

.study-record-audio.is-playing,
.study-record-recordings button.is-playing {
  color: var(--surface);
  border-color: var(--primary);
  background: var(--primary);
}

.study-record-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.study-record-score span {
  color: var(--success);
  background: #edf8f2;
  font-weight: 800;
}

.study-record-score span.is-warning {
  color: #9b6a00;
  background: #fff7dc;
}

.study-record-recordings {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.study-record-recordings .speaking-record-pill {
  min-height: 42px;
  border-color: #d5c2e8;
  padding: 8px 12px;
  color: #75509a;
  background: #f7f0fc;
  font-weight: 800;
}

.study-record-recordings .speaking-record-pill:hover,
.study-record-recordings .speaking-record-pill:focus-visible {
  border-color: #75509a;
  background: var(--surface);
}

.study-record-recordings .speaking-record-pill.is-playing {
  color: var(--surface);
  border-color: #75509a;
  background: #75509a;
}

.speaking-evaluation-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.speaking-evaluation-actions .button-primary {
  min-width: 112px;
}

.speaking-evaluation-actions span {
  color: var(--muted);
  font-size: 13px;
}

.speaking-evaluation-actions span.is-error {
  color: var(--danger, #b42318);
}

.speaking-group-evaluation-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.speaking-history-repair {
  display: grid;
  gap: 10px;
  border: 1px solid #ead9a9;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fffaf0;
}

.speaking-history-repair-head,
.speaking-history-repair-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speaking-history-repair-head span {
  color: var(--muted);
  font-size: 12px;
}

.speaking-history-repair-list {
  display: grid;
  gap: 8px;
}

.speaking-history-repair-row {
  border-top: 1px solid #efe3c4;
  padding-top: 8px;
}

.speaking-history-repair-row > span {
  display: grid;
  min-width: 0;
}

.speaking-history-repair-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.speaking-history-repair-row small {
  color: var(--muted);
}

.speaking-history-repair-row button {
  flex: 0 0 auto;
  border: 1px solid #d8bd78;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.speaking-history-repair-row button.is-recording {
  border-color: var(--danger, #b42318);
  color: #fff;
  background: var(--danger, #b42318);
}

.study-record-detail-backdrop.is-speaking-detail .study-record-detail-card {
  width: min(760px, calc(100vw - 32px));
}

.study-record-detail-backdrop.is-speaking-detail .section-head {
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  height: 0;
  margin-bottom: 0;
}

.study-record-detail-backdrop.is-speaking-detail .section-head > div {
  display: none;
}

.study-record-detail-backdrop.is-speaking-detail .section-head .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

.study-record-detail-backdrop.is-speaking-detail .study-record-detail-meta {
  gap: 6px;
  margin-bottom: 0;
}

.study-record-detail-backdrop.is-speaking-detail .study-record-detail-meta span {
  border: 1px solid var(--line);
  padding: 5px 10px;
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.study-record-detail-backdrop.is-speaking-detail .study-record-detail-panel {
  gap: 14px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-group-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding-right: 52px;
  margin-bottom: 14px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-group-analysis {
  border: 0;
  border-radius: 18px;
  padding: 20px 22px;
  background: #f1f8f4;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-group-analysis .speaking-ai-overall {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-group-evaluation-actions .button-primary {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 6px 13px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-group-evaluation-actions .button-primary:hover {
  border-color: var(--text);
  background: var(--surface);
}

.study-record-detail-backdrop.is-speaking-detail .speaking-phrase-list {
  gap: 8px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-phrase-row {
  border-color: transparent;
  padding: 13px 15px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-phrase-row strong {
  font-size: 15px;
}

.study-record-detail-backdrop.is-speaking-detail .speaking-phrase-result b {
  min-width: 64px;
  padding: 5px 11px;
  font-size: 14px;
}

.speaking-ai-analysis {
  display: grid;
  gap: 10px;
  border: 1px solid #d8e8df;
  border-radius: 16px;
  padding: 16px;
  background: #f4faf6;
}

.speaking-phrase-summary {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  background: var(--surface);
}

.speaking-phrase-summary .study-record-recordings {
  margin-top: 0;
}

.speaking-ai-analysis p,
.speaking-ai-analysis ul {
  margin: 0;
}

.speaking-coaching-analysis {
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
}

.speaking-coaching-list {
  display: grid;
  gap: 10px;
}

.speaking-coaching-block {
  display: grid;
  gap: 5px;
  border: 1px solid #dfe7e2;
  border-radius: 14px;
  padding: 13px 15px;
  background: #f8faf9;
}

.speaking-coaching-block strong {
  color: #65736c;
  font-size: 12px;
}

.speaking-coaching-block p {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.55;
}

.speaking-coaching-block.is-advice {
  border-color: #d5e8dc;
  background: #f2f9f5;
}

.speaking-coaching-block.is-advice strong {
  color: var(--success);
}

.speaking-ai-overall {
  color: var(--text);
  font-weight: 700;
}

.speaking-ai-attention {
  display: grid;
  gap: 6px;
}

.speaking-ai-attention ul {
  display: grid;
  gap: 4px;
  padding-left: 20px;
}

.speaking-ai-noise {
  color: var(--muted);
  font-size: 13px;
}

.speaking-ai-advice strong,
.speaking-ai-attention strong {
  color: var(--success);
}

.study-record-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.study-record-navigation button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.study-record-navigation button:hover:not(:disabled),
.study-record-navigation button:focus-visible:not(:disabled) {
  outline: none;
  border-color: var(--text);
  background: var(--surface-soft);
}

.study-record-navigation button:disabled {
  color: #aaa9a1;
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: .65;
}

@media (max-width: 640px) {
  .study-record-summary {
    width: 100%;
  }

  .speaking-phrase-detail-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .study-record-answer-grid,
  .speaking-evaluation-card {
    grid-template-columns: 1fr;
  }

  .study-record-match-row,
  .study-record-score {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-record-match-item,
  .study-record-match-audio,
  .study-record-match-answers {
    width: 100%;
    max-width: none;
  }

  .study-record-match-answer {
    padding: 2px 10px;
  }

  .study-record-match-answer:first-child {
    padding-left: 0;
  }

  .study-record-recordings {
    grid-template-columns: 1fr;
  }

  .speaking-evaluation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .speaking-evaluation-actions .button-primary {
    width: 100%;
  }

  .study-record-detail-backdrop.is-speaking-detail .speaking-group-analysis {
    padding: 16px;
  }

  .study-record-detail-backdrop.is-speaking-detail .speaking-group-analysis .speaking-ai-overall {
    font-size: 15px;
  }

  .study-record-detail-backdrop.is-speaking-detail .speaking-group-evaluation-actions {
    align-items: flex-end;
  }

  .study-record-detail-backdrop.is-speaking-detail .speaking-group-evaluation-actions .button-primary {
    width: auto;
  }
}

.modal-card-small {
  width: min(520px, 100%);
}

.card-review-modal-card {
  overflow: hidden;
  padding: 20px 24px;
  width: min(640px, 100%);
}

.card-review-modal-card > .section-head {
  margin-bottom: 8px;
}

.card-review-frame {
  display: block;
  width: 100%;
  height: min(580px, calc(100vh - 128px));
  border: 0;
  background: var(--surface);
}

.card-generation-modal {
  z-index: 130;
}

.card-generation-modal-card {
  overflow: hidden;
}

.card-generation-modal-body {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 8px 4px 4px;
  text-align: center;
}

.card-generation-spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
  color: var(--text);
}

.card-generation-message {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.card-generation-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.card-generation-stage {
  width: 100%;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 12px;
  background: var(--surface-soft, #f7f7f5);
  padding: 10px 14px;
  text-align: left;
}

.card-generation-stage-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #2f9d63);
}

.card-generation-stage-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Floating corpus card panel */
.corpus-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.corpus-card-overlay-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1000px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: default;
  user-select: none;
}

/* 个人语料卡片：阅读态使用更轻的层级，避免通用禁用色和重字重造成压迫感 */
.corpus-card-overlay-panel .corpus-card-form:not(.editing) {
  gap: 12px;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-toolbar {
  align-items: flex-start;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .corpus-card-meta {
  gap: 8px;
  color: #74746d;
  font-weight: 600;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .corpus-card-meta span {
  padding: 5px 10px;
  background: #f3f3ef;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-nav .button-ghost {
  min-height: 36px;
  padding: 8px 14px;
  background: #f3f3ef;
  font-weight: 650;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-title-input {
  color: #292927;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .audio-controls {
  border-color: #deded7;
  background: #f7f7f4;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-keyword-row {
  gap: 8px;
  border-color: #e1e1da;
  padding: 8px 12px;
  background: #fafaf7;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-keyword-label {
  color: #6f6f68;
  font-weight: 700;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-keyword-row .keyword-tag {
  border: 1px solid #e4e4dd;
  background: #f1f1ed;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-keyword-row .keyword-tag span {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-answer-grid {
  gap: 14px;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-answer-panel {
  border-color: #deded7;
  padding: 16px 18px;
  background: #f8f8f5;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-answer-panel textarea {
  color: #292927;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.68;
  letter-spacing: 0;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-answer-panel textarea[name="answer"] {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.62;
}

.corpus-card-overlay-panel .corpus-card-form:not(.editing) .stage-answer-toggle {
  color: #3e3e3a;
  font-size: 17px;
  font-weight: 700;
}

.corpus-card-overlay-panel.is-dragging {
  cursor: grabbing;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.26);
}

.corpus-card-overlay-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  margin: -6px -6px 8px;
  border-radius: 10px 10px 0 0;
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 2px;
  user-select: none;
}

.corpus-card-overlay-drag-handle:active {
  cursor: grabbing;
}

.corpus-card-overlay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.corpus-card-overlay-actions .corpus-card-overlay-close {
  position: static;
  margin-left: auto;
}

.corpus-card-overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  cursor: pointer;
}

.simple-modal-form {
  display: grid;
  gap: 12px;
}

.compact-textarea {
  min-height: 96px;
}

.today-question-delete-modal {
  z-index: 74;
}

.today-question-delete-modal-card {
  width: min(480px, 100%);
  padding: 28px;
  overflow: hidden;
}

.today-question-delete-modal-card > .section-head {
  align-items: center;
  flex-direction: row;
  margin-bottom: 24px;
}

.delete-question-preview {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--text);
  background: #fafaf7;
  line-height: 1.5;
}

.delete-question-prompt {
  color: var(--muted);
  font-size: 14px;
}

.delete-question-title {
  font-size: 16px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.delete-question-reminder-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.delete-question-reminder-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--danger);
}

.today-question-delete-modal-card .delete-question-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;
  gap: 10px;
  margin-top: 22px;
}

.delete-question-actions .button-danger {
  color: var(--surface);
  background: var(--danger);
}

.delete-question-actions .button-danger:hover {
  background: #971c13;
}

@media (max-width: 480px) {
  .today-question-edit-modal-card,
  .today-question-delete-modal-card {
    padding: 22px;
  }

  .today-question-delete-modal-card .delete-question-actions > button {
    flex: 1;
  }
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes editPulse {
  from {
    opacity: 0.86;
    transform: scale(0.992);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

#loginBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 80px;
  transition: opacity 150ms ease;
}

#loginBtn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

@keyframes skeletonSweep {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@keyframes modalLoadIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 1280px) {
  .workflow {
    gap: 24px;
  }

  .section-head {
    margin-bottom: 22px;
  }

  .control {
    min-height: 52px;
    border-radius: 18px;
    padding: 14px 16px;
  }

  .button-primary,
  .button-ghost,
  .button-danger {
    min-height: 48px;
    padding: 12px 20px;
  }
}

@media (max-width: 960px) {
  .app-shell {
    padding-left: 61px;
  }

  .app-shell:has(.sidebar.expanded) {
    padding-left: min(421px, 100vw);
  }

  .app-shell:has(.sidebar.account-expanded) {
    padding-left: 61px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: 61px;
    padding: 0;
  }

  .sidebar.expanded {
    width: min(421px, 100vw);
  }

  .sidebar.account-expanded {
    width: 61px;
  }

  .sidebar.expanded .sidebar-drawer {
    width: min(360px, calc(100vw - 61px));
  }

  .sidebar.account-expanded .sidebar-drawer {
    left: 68px;
    width: min(340px, calc(100vw - 80px));
  }

  .corpus-cards {
    grid-template-columns: 1fr;
  }

  .corpus-manager,
  .corpus-directory {
    overflow: visible;
  }

  .corpus-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .corpus-list-wrap {
    max-height: none;
  }

  .today-panel {
    position: static;
    margin-bottom: 8px;
  }

  .form-row-wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  #profileModal .profile-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #profileModal .profile-add-row {
    grid-template-columns: 1fr;
  }

  #profileModal .profile-form-actions > .button-primary {
    width: 100%;
  }

  .profile-modal-grid,
  .profile-table-row,
  .profile-add-row {
    grid-template-columns: 1fr;
  }

  .profile-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-section-actions {
    width: 100%;
  }

  .profile-section-actions .button-ghost {
    flex: 1;
  }

  .profile-table-head {
    display: none;
  }

  .profile-field-delete {
    justify-self: stretch;
  }

  .expression-toolbar,
  .corpus-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .corpus-list-item {
    grid-template-columns: 1fr;
  }

  .corpus-list-header-row {
    display: none;
  }

  .stage-toolbar,
  .corpus-stage-top {
    grid-template-columns: 1fr;
  }

  .stage-toolbar {
    display: grid;
  }

  .stage-nav {
    justify-content: stretch;
  }

  .stage-nav button {
    flex: 1;
  }

  .audio-controls {
    grid-template-columns: 34px minmax(100px, 1fr) auto auto;
  }

  .audio-replay,
  .audio-jump-group,
  .audio-speed,
  .audio-volume {
    grid-row: 2;
  }

  .audio-volume {
    grid-column: span 2;
  }

  .stage-title-input {
    font-size: 22px;
  }

  .question-editor {
    font-size: 21px;
  }

  .expression-filters,
  .corpus-filters {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .modal-card {
    max-height: calc(100vh - 24px);
  }

  .sidebar.expanded .sidebar-drawer {
    width: calc(100vw - 61px);
    max-width: none;
    max-height: 100vh;
  }

  main {
    padding: 18px;
  }

  .section-head,
  .action-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .question-box p {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-primary,
  .button-ghost,
  .button-danger,
  .icon-button,
  .text-button,
  .profile-button,
  .question-play-button,
  .question-replay-button,
  .stage-question-replay,
  .stage-nav button,
  .today-mini-button,
  .keyword-add-button,
  .keyword-icon-button,
  .audio-play,
  .audio-replay,
  .audio-jump-group button,
  .audio-speed select,
  .stage-keyword-editor-row,
  .corpus-card-form.editing .stage-lane,
  .corpus-card-form.editing .stage-fold,
  .corpus-card-form.editing .stage-answer-field {
    transition: none;
  }

  .button-primary:not(:disabled):hover,
  .button-ghost:not(:disabled):hover,
  .button-danger:not(:disabled):hover,
  .icon-button:not(:disabled):hover,
  .text-button:not(:disabled):hover,
  .profile-button:not(:disabled):hover,
  .question-play-button:not(:disabled):hover,
  .question-replay-button:not(:disabled):hover,
  .stage-question-replay:not(:disabled):hover,
  .stage-nav button:not(:disabled):hover,
  .today-mini-button:not(:disabled):hover,
  .keyword-add-button:not(:disabled):hover,
  .keyword-icon-button:not(:disabled):hover,
  .audio-play:not(:disabled):hover,
  .audio-replay:not(:disabled):hover,
  .audio-jump-group button:not(:disabled):hover,
  .audio-speed select:not(:disabled):hover,
  .stage-keyword-editor-row:hover,
  .corpus-card-form.editing .stage-lane:hover,
  .corpus-card-form.editing .stage-fold:hover,
  .corpus-card-form.editing .stage-answer-field:hover {
    transform: none;
  }
}

.listening-page-body {
  min-height: 100vh;
  background: var(--page);
}

.listening-page {
  width: min(760px, 100%);
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: clamp(18px, 4vw, 40px);
}

.app-shell .listening-page {
  width: 100%;
  max-width: 1680px;
  min-height: auto;
  align-content: start;
}

.listening-brandbar {
  margin-bottom: 0;
}

.listening-shell {
  display: grid;
  gap: 12px;
}

.listening-stage,
.listening-options-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.listening-stage {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.listening-topline,
.listening-feedback-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.listening-stage .tag {
  color: var(--text);
  background: var(--surface-soft);
}

.listening-stage .tag.muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.listening-prompt h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

.listening-prompt .eyebrow,
.listening-prompt .section-subtitle {
  color: rgba(255, 255, 255, 0.72);
}

.listening-play-button {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--surface);
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.listening-play-button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  font-size: 11px;
}

.listening-options-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.listening-options-head {
  margin-bottom: 4px;
}

.listening-expression-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 800;
}

.listening-options {
  display: grid;
  gap: 12px;
}

.listening-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.listening-option:not(:disabled):hover,
.listening-option:not(:disabled):focus-visible {
  border-color: var(--text);
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

.listening-option span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.listening-option strong {
  min-width: 0;
  line-height: 1.45;
}

.listening-option:disabled {
  cursor: default;
}

.listening-option.is-correct {
  border-color: var(--success-light);
  background: var(--success-bg);
}

.listening-option.is-correct span {
  background: var(--success);
}

.listening-option.is-wrong {
  border-color: var(--danger-light);
  background: var(--danger-bg);
}

.listening-option.is-wrong span {
  background: var(--danger);
}

.listening-feedback-row {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.listening-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.listening-feedback.is-correct {
  color: var(--success);
}

.listening-feedback.is-wrong {
  color: var(--danger);
}

@media (max-width: 900px) {
  .listening-page {
    align-content: start;
  }

  .listening-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .listening-play-button,
  .listening-feedback-row .button-primary {
    width: 100%;
  }

  .listening-option {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 68px;
    padding: 12px;
  }

  .listening-option span {
    width: 34px;
    height: 34px;
  }
}

.listening-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
}

.listening-card .listening-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0 0 14px;
  background: transparent;
}

.listening-card .listening-topline {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.listening-card .listening-prompt h1 {
  font-size: 22px;
}

.listening-card .listening-play-button {
  width: 82px;
  height: 48px;
  min-height: 48px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
}

.listening-card .listening-play-button strong {
  font-size: 13px;
}

.listening-wave-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 28px;
  height: 24px;
}

.listening-wave-icon i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

.listening-wave-icon i:nth-child(2) {
  height: 14px;
}

.listening-wave-icon i:nth-child(3) {
  height: 22px;
}

.listening-wave-icon i:nth-child(4) {
  height: 14px;
}

.listening-wave-icon i:nth-child(5) {
  height: 10px;
}

.listening-play-button.is-waving .listening-wave-icon i {
  animation: listeningWaveTap 520ms ease-in-out 2;
}

.listening-play-button.is-waving .listening-wave-icon i:nth-child(2) {
  animation-delay: 60ms;
}

.listening-play-button.is-waving .listening-wave-icon i:nth-child(3) {
  animation-delay: 120ms;
}

.listening-play-button.is-waving .listening-wave-icon i:nth-child(4) {
  animation-delay: 180ms;
}

.listening-play-button.is-waving .listening-wave-icon i:nth-child(5) {
  animation-delay: 240ms;
}

.listening-card .listening-options-panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0 0;
}

.listening-card .listening-options-head {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

@keyframes listeningWaveTap {
  0%,
  100% {
    transform: scaleY(0.7);
  }

  50% {
    transform: scaleY(1.35);
  }
}

@media (max-width: 640px) {
  .listening-card .listening-card-head {
    grid-template-columns: 1fr;
  }

  .listening-card .listening-play-button {
    width: 100%;
    justify-self: stretch;
  }
}

.listening-page .listening-card {
  display: grid;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  background: var(--surface);
  animation: listeningCardEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.listening-page .listening-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 0;
}

.listening-page .listening-topline,
.listening-page .listening-prompt,
.listening-page .listening-play-button,
.listening-page .listening-options-head,
.listening-page .listening-feedback-row {
  animation: listeningLayerEnter 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.listening-page .listening-topline {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  animation-delay: 50ms;
}

.listening-page .listening-prompt h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.listening-page .listening-prompt {
  animation-delay: 90ms;
}

.listening-page .listening-play-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  height: 64px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 16, 16, 0.08);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  box-shadow: none;
  animation-delay: 130ms;
}

.listening-page .listening-play-button .listening-wave-icon {
  display: inline-flex;
  width: 34px;
  height: 24px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 0;
  color: inherit;
  background: transparent;
}

.listening-page .listening-play-button:hover,
.listening-page .listening-play-button:focus-visible {
  border-color: rgba(16, 16, 16, 0.14);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  box-shadow: none;
}

.listening-page .listening-wave-icon i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.listening-page .listening-wave-icon i:nth-child(1) {
  height: 8px;
}

.listening-page .listening-wave-icon i:nth-child(2) {
  height: 14px;
}

.listening-page .listening-wave-icon i:nth-child(3) {
  height: 22px;
}

.listening-page .listening-wave-icon i:nth-child(4) {
  height: 14px;
}

.listening-page .listening-wave-icon i:nth-child(5) {
  height: 8px;
}

.listening-page .listening-options-panel {
  display: grid;
  gap: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0 0;
  background: transparent;
}

.listening-page .listening-options-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0;
  animation-delay: 190ms;
}

.listening-page .listening-options-head h2 {
  font-size: 22px;
}

.listening-page .listening-options {
  display: grid;
  gap: 14px;
}

.listening-page .listening-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  animation: listeningOptionEnter 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.listening-page .listening-option:nth-child(1) {
  animation-delay: 240ms;
}

.listening-page .listening-option:nth-child(2) {
  animation-delay: 285ms;
}

.listening-page .listening-option:nth-child(3) {
  animation-delay: 330ms;
}

.listening-page .listening-option:nth-child(4) {
  animation-delay: 375ms;
}

.listening-page .listening-feedback-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  animation-delay: 410ms;
}

.listening-page .listening-feedback.is-correct,
.listening-page .listening-feedback.is-wrong {
  animation: listeningFeedbackEnter 180ms ease-out both;
}

.listening-page .is-question-switching {
  animation: listeningQuestionSwitch 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.listening-page .listening-topline.is-question-switching {
  animation-delay: 0ms;
}

.listening-page .listening-prompt.is-question-switching {
  animation-delay: 35ms;
}

.listening-page .listening-play-button.is-question-switching {
  animation-delay: 70ms;
}

.listening-page .listening-options-head.is-question-switching {
  animation-delay: 105ms;
}

.listening-page .listening-option.is-question-switching:nth-child(1) {
  animation-delay: 135ms;
}

.listening-page .listening-option.is-question-switching:nth-child(2) {
  animation-delay: 170ms;
}

.listening-page .listening-option.is-question-switching:nth-child(3) {
  animation-delay: 205ms;
}

.listening-page .listening-option.is-question-switching:nth-child(4) {
  animation-delay: 240ms;
}

.listening-page .listening-feedback-row.is-question-switching {
  animation-delay: 270ms;
}

.listening-page .listening-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.listening-page .listening-option {
  min-height: 112px;
  padding: 18px;
}

@media (max-width: 640px) {
  .listening-page .listening-options {
    grid-template-columns: 1fr;
  }

  .listening-page .listening-option {
    min-height: 58px;
    padding: 12px;
  }

  .listening-page .listening-card {
    padding: 20px;
  }

  .listening-page .listening-prompt h1 {
    font-size: 24px;
  }
}

@keyframes listeningCardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes listeningLayerEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes listeningOptionEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes listeningFeedbackEnter {
  from {
    opacity: 0.72;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes listeningQuestionSwitch {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .listening-page .listening-card,
  .listening-page .listening-topline,
  .listening-page .listening-prompt,
  .listening-page .listening-play-button,
  .listening-page .listening-options-head,
  .listening-page .listening-option,
  .listening-page .listening-feedback-row,
  .listening-page .is-question-switching,
  .listening-page .listening-feedback.is-correct,
  .listening-page .listening-feedback.is-wrong {
    animation: none;
  }

  .today-page .today-panel,
  .today-page .today-panel-head,
  .today-page .today-question-item,
  .today-page .today-question-player-title,
  .today-page .audio-card,
  .today-page .today-question-keyword-card,
  .today-page .today-question-fold,
  .today-page .is-today-switching {
    animation: none;
  }
}

.listening-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  width: min(100vw - 40px, 920px);
  margin: 0 auto;
}

.practice-nav {
  display: grid;
  gap: 10px;
  position: fixed;
  top: 33%;
  right: 0;
  z-index: 20;
  width: 76px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding: 12px 14px;
  background: var(--surface);
  overflow: hidden;
  transition:
    width 180ms ease,
    box-shadow 180ms ease;
}

.practice-nav:hover,
.practice-nav:focus-within {
  width: 238px;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.12);
}

.practice-nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 210px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-soft);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.practice-nav-item strong {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms ease;
}

.practice-nav-item-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.practice-nav-progress {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.practice-nav-progress.is-done {
  color: var(--success-text);
  background: var(--success-bg);
}

.practice-nav-item.is-done {
  border-color: var(--success-light);
  background: var(--success-bg);
}

.practice-nav-item.is-done .practice-nav-icon {
  background: var(--success);
}

.practice-nav-item.is-done .practice-nav-progress {
  color: var(--surface);
  background: var(--success);
}

.practice-nav:hover .practice-nav-item strong,
.practice-nav:focus-within .practice-nav-item strong {
  opacity: 1;
}

.practice-nav:hover .practice-nav-item-text,
.practice-nav:focus-within .practice-nav-item-text {
  opacity: 1;
}

.practice-nav-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  background: var(--primary);
}

.practice-nav-icon-soft {
  color: var(--text);
  background: var(--surface-soft);
  font-size: 18px;
  font-weight: 900;
}

.practice-edit-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.practice-nav-svg {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.practice-nav-icon-soft .practice-nav-svg {
  color: var(--text);
}

.practice-nav-setting {
  margin-bottom: 0;
}

/* ── 统一任务计数 ── */

.practice-nav-task-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
  opacity: 0;
  transition: opacity 120ms ease;
}

.practice-nav:hover .practice-nav-task-text,
.practice-nav:focus-within .practice-nav-task-text {
  opacity: 1;
}

.practice-nav-task-text strong {
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.practice-nav-task-label {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  color: var(--primary);
}

.practice-nav-task-label.is-done {
  color: var(--success-text);
}

.practice-nav-task-bar {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.practice-nav-task-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 300ms ease;
}

.practice-nav-task-label.is-done + .practice-nav-task-bar .practice-nav-task-bar-fill {
  background: var(--success-text);
}

.practice-nav-icon i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: var(--surface);
}

.practice-nav-icon i:nth-child(1) {
  height: 12px;
}

.practice-nav-icon i:nth-child(2) {
  height: 22px;
}

.practice-nav-icon i:nth-child(3) {
  height: 16px;
}

.practice-nav-item:hover,
.practice-nav-item:focus-visible,
.practice-nav-item.is-active {
  border-color: var(--line-dark);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.08);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .listening-workspace {
    grid-template-columns: 1fr;
    width: min(100vw - 36px, 920px);
  }

  .practice-nav {
    top: auto;
    right: 0;
    bottom: 18px;
    transform: none;
  }
}

/* ── 任务详情弹窗 ──────────────────────────────────────────── */

.tsm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(4px);
}

.tsm-backdrop[hidden] {
  display: none;
}

.tsm-modal {
  width: min(400px, calc(100vw - 32px));
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(17, 17, 17, 0.18);
  overflow: hidden;
}

.tsm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}

.tsm-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.sidebar-task-settings-panel .tsm-head {
  justify-content: center;
  gap: 8px;
  padding: 18px 0 10px;
  text-align: center;
}

.tsm-title-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.tsm-title-icon svg {
  display: block;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--muted-orange);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tsm-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tsm-close:hover {
  background: var(--line);
  color: var(--text);
}

.tsm-body {
  padding: 4px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tsm-loading {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
}

.tsm-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tsm-module-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.tsm-quota-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  -moz-appearance: textfield;
  box-sizing: border-box;
}

.tsm-quota-input::-webkit-inner-spin-button,
.tsm-quota-input::-webkit-outer-spin-button {
  opacity: 1;
}

.tsm-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.tsm-save-hint {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}

.tsm-content-warning {
  display: block;
  margin: 14px 20px 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.tsm-content-warning[hidden] {
  display: none;
}

.tsm-save-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 120ms ease;
}

.tsm-save-btn:hover {
  opacity: 0.88;
}

/* 配额编辑 */

/* 警告 */

.tsm-warnings {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tsm-warning {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  line-height: 1.4;
}

.listening-page .listening-play-button {
  height: 86px;
  min-height: 86px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.listening-page .listening-play-button:hover,
.listening-page .listening-play-button:focus-visible {
  background: rgba(232, 232, 226, 0.94);
}

.listening-page .listening-wave-line {
  height: 62px;
}

.listening-page .listening-wave-line .wave-form {
  stroke: rgba(17, 17, 17, 0.9);
  stroke-width: 4.2;
}

.listening-play-button.is-waving .listening-wave-line .wave-form {
  animation-duration: 520ms;
}

.listening-page .listening-play-button {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 24%, transparent);
  padding: 0 22px;
}

.listening-page .listening-play-button:hover,
.listening-page .listening-play-button:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 42%, transparent);
  box-shadow: none;
}

.listening-page .listening-play-button .listening-wave-icon {
  width: min(100%, 620px);
  height: 30px;
  justify-content: space-between;
  gap: 0;
}

.listening-page .listening-wave-line {
  display: block;
  width: min(100%, 640px);
  height: 42px;
}

.listening-page .listening-wave-line .wave-center {
  fill: none;
  stroke: rgba(17, 17, 17, 0.12);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.listening-page .listening-wave-line .wave-form {
  fill: none;
  stroke: rgba(17, 17, 17, 0.68);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.listening-play-button.is-waving .listening-wave-line .wave-form {
  animation: listeningWaveFlow 520ms ease-in-out infinite;
}

@keyframes listeningWaveFlow {
  0%,
  100% {
    transform: scaleY(1);
    transform-origin: center;
  }

  50% {
    transform: scaleY(1.55);
    transform-origin: center;
  }
}

.listening-page .listening-wave-icon i {
  width: 4px;
  background: rgba(17, 17, 17, 0.72);
}

.listening-page .listening-wave-icon i:nth-child(1),
.listening-page .listening-wave-icon i:nth-child(9) {
  height: 10px;
}

.listening-page .listening-wave-icon i:nth-child(2),
.listening-page .listening-wave-icon i:nth-child(8),
.listening-page .listening-wave-icon i:nth-child(14) {
  height: 16px;
}

.listening-page .listening-wave-icon i:nth-child(3),
.listening-page .listening-wave-icon i:nth-child(7),
.listening-page .listening-wave-icon i:nth-child(11) {
  height: 24px;
}

.listening-page .listening-wave-icon i:nth-child(4),
.listening-page .listening-wave-icon i:nth-child(6),
.listening-page .listening-wave-icon i:nth-child(12) {
  height: 18px;
}

.listening-page .listening-wave-icon i:nth-child(5),
.listening-page .listening-wave-icon i:nth-child(10),
.listening-page .listening-wave-icon i:nth-child(15) {
  height: 28px;
}

.listening-page .listening-wave-icon i:nth-child(13) {
  height: 12px;
}

.listening-page .listening-play-button .listening-wave-line + .listening-wave-icon {
  display: none;
}

.listening-count-button {
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.listening-count-button:hover,
.listening-count-button:focus-visible {
  background: var(--primary-soft);
}

.listening-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.22);
}

.listening-modal {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.16);
}

.listening-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.listening-modal-head h2 {
  font-size: 18px;
}

.listening-modal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.listening-modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* Align secondary practice pages with the Today page rhythm. */
.app-shell .listening-page,
.app-shell .matching-page {
  display: grid;
  gap: 18px;
  width: min(100% - 32px, 1120px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 0 72px;
  align-content: start;
}

.listening-workspace {
  width: 100%;
}

.listening-page .listening-card,
.matching-shell {
  width: 100%;
  max-width: min(980px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 24px 20px;
  background: var(--surface);
}

.listening-page .listening-card {
  gap: 16px;
}

.listening-page .listening-card-head {
  gap: 12px;
}

.listening-page .listening-prompt h1,
.matching-head h1 {
  font-size: 24px;
  line-height: 1.25;
}

.listening-page .listening-play-button {
  justify-self: center;
  width: min(100%, 420px);
  height: 64px;
  min-height: 64px;
  padding: 0 18px;
}

.listening-page .listening-wave-line {
  width: min(100%, 320px);
  height: 38px;
}

.listening-page .listening-options-panel {
  gap: 12px;
  padding-top: 16px;
}

.listening-page .listening-options-head h2 {
  font-size: 18px;
}

.listening-page .listening-options {
  gap: 12px;
}

.listening-page .listening-option {
  min-height: 82px;
  border-radius: 12px;
  padding: 14px;
}

.matching-shell {
  display: grid;
  gap: 16px;
  justify-items: stretch;
}

.matching-grid {
  grid-template-columns: minmax(260px, 320px) minmax(420px, 580px);
  justify-content: center;
  gap: clamp(28px, 4vw, 48px);
  margin-top: 0;
}

.matching-audio-list,
.matching-meaning-list {
  gap: 12px;
  margin-top: 0;
}

.matching-audio-list {
  padding: 0;
  width: min(100%, 260px);
  justify-self: end;
}

.matching-audio-card {
  min-height: 74px;
}

.matching-play {
  width: 210px;
  height: 58px;
  border-width: 1px;
  gap: 13px;
}

.matching-play-icon {
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 15px;
}

.matching-play-divider {
  height: 38px;
}

.matching-play-wave {
  height: 38px;
}

.matching-play-wave i {
  width: 5px;
}

.matching-meaning-card {
  min-height: 74px;
}

.matching-actions {
  width: 100%;
  max-width: min(948px, 100%);
  justify-self: center;
  margin-top: 0;
}

@media (max-width: 900px) {
  .app-shell .listening-page,
  .app-shell .matching-page {
    width: min(100% - 32px, 1120px);
  }

  .listening-workspace {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .listening-page .listening-card,
  .matching-shell {
    padding: 20px;
  }

  .listening-page .listening-prompt h1,
  .matching-head h1 {
    font-size: 22px;
  }

  .listening-page .listening-option {
    min-height: 58px;
    padding: 12px;
  }

  .listening-page .listening-play-button,
  .matching-play {
    width: 100%;
  }
}

/* ===== Speaking (口语训练) ===== */
@media (max-width: 720px) {
  .matching-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .matching-audio-list {
    justify-self: center;
  }

  .matching-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.speaking-page-body {
  min-height: 100vh;
  background: var(--page);
}

.speaking-page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: clamp(18px, 4vw, 40px);
}

.app-shell .speaking-page {
  display: grid;
  gap: 18px;
  width: min(100% - 32px, 1120px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 0 72px;
  align-content: start;
  min-height: auto;
}

.speaking-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

/* ===== 上：模式选择容器 ===== */
.speaking-mode-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 20px;
  background: var(--surface);
  animation: speakingCardEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* 嵌入 today-page 时放宽宽度 */
.speaking-step .speaking-mode-shell {
  max-width: 100%;
  padding: 20px 28px;
}

/* ===== 下：回答区容器（窄、接近正方形） ===== */
.speaking-practice-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
  width: 100%;
}

.speaking-practice-shell {
  position: relative;
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 64px 40px 34px;
  background: var(--surface);
  animation: speakingCardEnter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 80ms;
}

/* 嵌入 today-page 时放宽宽度 */
.speaking-step .speaking-practice-shell {
  max-width: 100%;
  padding: 68px 48px 40px;
}

/* ===== 嵌入 today-page 时的字体放大 ===== */
.speaking-step .speaking-mode-label {
  font-size: 17px;
}

.speaking-step .speaking-mode-tab {
  padding: 8px 20px;
  font-size: 15px;
}

.speaking-step .speaking-mode-icon-svg {
  width: 18px;
  height: 18px;
}

.speaking-step .speaking-progress-label {
  font-size: 14px;
}

.speaking-step .speaking-speed-label {
  font-size: 14px;
}

.speaking-step .speaking-speed-value {
  font-size: 14px;
  min-width: 42px;
}

.speaking-step .speaking-speed-control input[type="range"] {
  width: 100px;
}

.speaking-step .speaking-english-text {
  font-size: 34px;
}

.speaking-step .speaking-chinese-text {
  font-size: 34px;
}

.speaking-step .speaking-english-card {
  padding: 36px 32px;
}

.speaking-step .speaking-chinese-card {
  padding: 36px 32px;
}

.speaking-step .speaking-record-button {
  min-height: 72px;
  padding: 12px 36px;
  font-size: 18px;
}

.speaking-step .speaking-mic-icon {
  width: 32px;
  height: 32px;
}

.speaking-step .speaking-mic-icon svg {
  width: 28px;
  height: 28px;
}

.speaking-step .speaking-feedback {
  font-size: 16px;
}

.speaking-step .speaking-play-audio {
  width: 100%;
  max-width: 100%;
  height: 72px;
  min-height: 72px;
  gap: 12px;
}

.speaking-step .speaking-card-number {
  font-size: 15px;
  min-width: 50px;
  height: 34px;
  padding: 0 14px;
}

.speaking-step .speaking-done-badge {
  font-size: 15px;
  padding: 8px 16px;
}

.speaking-step .speaking-done-badge svg {
  width: 16px;
  height: 16px;
}

.speaking-step .speaking-feedback-row {
  padding-top: 18px;
}

.speaking-step .speaking-mode-bar {
  gap: 12px;
}

.speaking-step .speaking-mode-head {
  gap: 24px;
}

.speaking-step .speaking-workspace {
  gap: 24px;
}

.speaking-step .speaking-practice-shell {
  gap: 24px;
}

.speaking-card-progress {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.speaking-card-number {
  display: inline-flex;
  min-width: 44px;
  height: 30px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--surface);
  background: var(--success);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
}

/* 本组可点击进度固定在练习卡片内，避免被外层布局裁切。 */
.speaking-done-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.speaking-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--surface);
  background: var(--success);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 111, 82, 0.32);
  animation: speakingDonePop 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  white-space: nowrap;
}

.speaking-done-badge:hover,
.speaking-done-badge:focus-visible {
  background: var(--success-dark);
  outline: none;
  transform: translateY(-1px);
}

.speaking-done-badge.is-missing {
  color: var(--muted);
  background: var(--line);
  box-shadow: none;
}

.speaking-done-badge.is-missing:hover,
.speaking-done-badge.is-missing:focus-visible {
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.12);
}

.speaking-done-badge.is-pending {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  box-shadow: none;
}

.speaking-done-badge.is-processing {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  box-shadow: none;
  animation: speakingAsrPulse 1.2s ease-in-out infinite;
}

@keyframes speakingAsrPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.speaking-done-badge.is-pending:hover,
.speaking-done-badge.is-pending:focus-visible {
  color: var(--text);
  background: var(--line);
  outline: none;
}

.speaking-done-badge svg {
  width: 14px;
  height: 14px;
}

@keyframes speakingDonePop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 听力完成泡泡 ===== */
.listening-done-list {
  position: absolute;
  top: 0;
  left: calc(50% + 476px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 68px;
}

.listening-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--surface);
  background: var(--success);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 111, 82, 0.32);
  animation: listeningDonePop 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  white-space: nowrap;
}

.listening-done-badge:hover,
.listening-done-badge:focus-visible {
  background: var(--success-dark);
  outline: none;
  transform: translateY(-1px);
}

.listening-done-badge svg {
  width: 14px;
  height: 14px;
}

@keyframes listeningDonePop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 完成弹窗 ===== */
.speaking-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.32);
}

.speaking-modal {
  display: grid;
  gap: 18px;
  width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 24px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
  text-align: center;
  animation: speakingDonePop 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ===== 评分等待弹窗 ===== */
.speaking-scoring-modal {
  justify-items: center;
  width: min(300px, 100%);
  padding: 28px 24px;
}

.speaking-scoring-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: speakingScoringSpin 800ms linear infinite;
}

@keyframes speakingScoringSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 发音报告弹窗 ===== */
.speaking-report-modal {
  width: min(560px, 100%);
  text-align: left;
}

.speaking-report-header {
  display: grid;
  gap: 4px;
}

.speaking-report-header h2 {
  margin: 0;
  font-size: 18px;
}

.speaking-report-list {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
}

.speaking-report-loading {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

.speaking-report-ai-summary {
  display: grid;
  gap: 6px;
  border: 1px solid #cfe3da;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f1f8f5;
}

.speaking-report-ai-summary p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.speaking-report-ai-summary.is-unavailable {
  border-color: var(--line);
  background: var(--surface-soft, var(--surface));
}

.speaking-report-ai-summary.is-unavailable .speaking-report-ai-label {
  color: var(--muted);
}

.speaking-report-ai-label {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.speaking-submit-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.speaking-submit-actions #nextQuestionBtn:disabled {
  color: var(--surface);
  background: var(--danger);
  opacity: 0.65;
}

.speaking-report-actions {
  display: flex;
  gap: 10px;
}

.speaking-report-actions > button {
  flex: 1;
}

.speaking-report-back {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

.speaking-report-back:hover,
.speaking-report-back:focus-visible {
  border-color: var(--primary);
}

.speaking-report-resubmit {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

.speaking-report-resubmit:hover,
.speaking-report-resubmit:focus-visible {
  border-color: var(--primary);
}

.speaking-report-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-soft, var(--surface));
}

.speaking-report-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.speaking-report-en {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speaking-report-zh {
  font-size: 12px;
  color: var(--muted);
}

.speaking-report-ai-detail {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  color: #4f6259;
  font-size: 11px;
  line-height: 1.5;
}

.speaking-report-ai-detail > span {
  display: grid;
  gap: 2px;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  padding: 5px 7px;
  background: #f8faf9;
}

.speaking-report-ai-detail strong {
  color: var(--success);
}

.speaking-report-ai-detail em {
  color: inherit;
  font-style: normal;
}

.speaking-report-error {
  margin-top: 5px;
  color: #a44737;
  font-size: 12px;
  line-height: 1.5;
}

.speaking-report-asr-mismatch {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.speaking-report-asr-mismatch > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.speaking-report-asr-mismatch button {
  flex-shrink: 0;
  border: 1px solid #d8a79e;
  border-radius: 999px;
  padding: 4px 9px;
  color: #8f382b;
  background: #fff7f5;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.speaking-report-scores {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.speaking-report-detail {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.speaking-report-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.speaking-report-badge.is-good {
  background: var(--success-bg, #e6f9f0);
  color: var(--success);
}

.speaking-report-badge.is-excellent,
.speaking-level-badge.is-excellent {
  background: #e0f2fe;
  color: #0369a1;
}

.speaking-report-badge.is-ok {
  background: #fff8e1;
  color: #b45309;
}

.speaking-report-badge.is-bad {
  background: #fef2f2;
  color: var(--danger);
}

.speaking-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.speaking-level-badge.is-good {
  background: var(--success-bg, #e6f9f0);
  color: var(--success);
}

.speaking-level-badge.is-bad {
  background: #fef2f2;
  color: var(--danger);
}

.speaking-report-patterns {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.speaking-report-ai-detail ul,
.speaking-coaching-block ul {
  margin: 4px 0 0;
  padding-left: 18px;
  line-height: 1.6;
}

.speaking-report-ai-detail li,
.speaking-coaching-block li {
  margin: 2px 0;
}

.speaking-report-ai-detail li b,
.speaking-coaching-block li b {
  color: var(--text, #1f2937);
  font-weight: 700;
}

.speaking-issue-suggestion {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.speaking-coaching-comment {
  margin: 0 0 10px;
  line-height: 1.6;
}

.speaking-report-badge.is-fail {
  background: var(--surface-soft, #f5f7fb);
  color: var(--muted);
}

.speaking-report-badge.is-skip {
  background: var(--surface-soft, #f5f7fb);
  color: var(--muted);
}

.speaking-modal-body {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.speaking-modal-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--success);
  font-size: 28px;
  font-weight: 900;
}

.speaking-modal h2 {
  margin: 0;
  font-size: 20px;
}

.speaking-modal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ===== 模式切换栏 ===== */
.speaking-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.speaking-mode-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.speaking-progress-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.speaking-speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.speaking-speed-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.speaking-speed-control input[type="range"] {
  width: 80px;
  accent-color: var(--primary);
}

.speaking-speed-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.speaking-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.speaking-mode-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.speaking-mode-tab:hover,
.speaking-mode-tab:focus-visible {
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.08);
  transform: translateY(-1px);
}

.speaking-mode-tab.is-active {
  border-color: var(--text);
  background: var(--primary);
  color: var(--surface);
}

.speaking-mode-tab.is-complete {
  border-color: var(--success);
  background: var(--success);
  color: var(--surface);
}

.speaking-mode-tab.is-complete.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--success);
}

.speaking-mode-label {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.speaking-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.speaking-topline .tag {
  color: var(--text);
  background: var(--surface-soft);
}

.speaking-topline .tag.muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.speaking-mode-badge {
  color: var(--surface) !important;
  background: var(--primary) !important;
}

.speaking-prompt h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.speaking-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* ===== 听→说：播放按钮 ===== */
.speaking-play-audio {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 580px);
  height: 72px;
  min-height: 72px;
  border: 1px solid rgba(16, 16, 16, 0.08);
  border-radius: 12px;
  padding: 0 18px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.speaking-play-audio:hover,
.speaking-play-audio:focus-visible {
  border-color: rgba(16, 16, 16, 0.14);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.speaking-play-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

.speaking-wave-line {
  display: block;
  width: min(100%, 460px);
  flex: 0 1 460px;
  height: 44px;
}

.speaking-wave-line .wave-center {
  fill: none;
  stroke: rgba(17, 17, 17, 0.12);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.speaking-wave-line .wave-form {
  fill: none;
  stroke: rgba(17, 17, 17, 0.68);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.speaking-play-audio.is-waving .speaking-wave-line .wave-form {
  animation: speakingWaveFlow 520ms ease-in-out infinite;
}

@keyframes speakingWaveFlow {
  0%, 100% { transform: scaleY(1); transform-origin: center; }
  50% { transform: scaleY(1.55); transform-origin: center; }
}

/* ===== 看→读：英文展示区 ===== */
.speaking-english-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  background: var(--surface-soft);
  text-align: center;
}

.speaking-english-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.speaking-english-text {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
}

/* ===== 看→说：中文展示区 ===== */
.speaking-chinese-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  background: var(--surface-soft);
  text-align: center;
}

.speaking-chinese-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.speaking-chinese-text {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
}

/* ===== 录音按钮 ===== */
.speaking-record-button {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 12px 36px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.speaking-record-button:not(:disabled):hover,
.speaking-record-button:not(:disabled):focus-visible {
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.14);
  transform: translateY(-1px) scale(1.02);
}

.speaking-record-button:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.speaking-record-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.speaking-record-button.is-recording {
  border-color: var(--danger);
  color: var(--surface);
  background: var(--danger);
  animation: speakingPulse 1.2s ease-in-out infinite;
}

.speaking-record-button.is-recorded {
  border-color: var(--success);
  color: var(--surface);
  background: var(--success);
}

/* ===== 录音行：录音按钮 + 播放录音图标 ===== */
.speaking-record-row {
  display: flex;
  justify-self: center;
  align-items: center;
  gap: 14px;
}

.speaking-play-record {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2px solid var(--line);
  border-radius: 50%;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  cursor: not-allowed;
  opacity: 0.4;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.speaking-play-record svg {
  width: 22px;
  height: 22px;
}

.speaking-play-record.is-ready {
  border-color: var(--success);
  color: var(--success);
  cursor: pointer;
  opacity: 1;
}

.speaking-play-record.is-ready:hover,
.speaking-play-record.is-ready:focus-visible {
  background: var(--success);
  color: var(--surface);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.12);
  transform: translateY(-1px) scale(1.06);
}

.speaking-play-record.is-ready:active {
  transform: translateY(0) scale(0.96);
}

.speaking-mic-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.speaking-mic-icon svg {
  width: 24px;
  height: 24px;
}

/* ===== 识别结果区 ===== */
.speaking-recognition {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: var(--surface-soft);
}

.speaking-recognition-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.speaking-recognition-text {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  min-height: 30px;
}

/* ===== 参考答案 ===== */
.speaking-answer-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.speaking-answer-text {
  margin: 0;
  width: 100%;
  border: 1px solid var(--success-light);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--success-bg);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

/* ===== 反馈行 ===== */
.speaking-feedback-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.speaking-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.speaking-feedback.is-correct {
  color: var(--success);
}

.speaking-feedback.is-wrong {
  color: var(--danger);
}

/* ===== 入场动画 ===== */
.speaking-page .speaking-mode-bar,
.speaking-page .speaking-topline,
.speaking-page .speaking-play-audio,
.speaking-page .speaking-english-card,
.speaking-page .speaking-chinese-card,
.speaking-page .speaking-record-button,
.speaking-page .speaking-recognition,
.speaking-page .speaking-feedback-row,
.speaking-step .speaking-mode-bar,
.speaking-step .speaking-topline,
.speaking-step .speaking-play-audio,
.speaking-step .speaking-english-card,
.speaking-step .speaking-chinese-card,
.speaking-step .speaking-record-button,
.speaking-step .speaking-recognition,
.speaking-step .speaking-feedback-row {
  animation: speakingLayerEnter 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.speaking-page .speaking-mode-bar,
.speaking-step .speaking-mode-bar {
  animation-delay: 40ms;
}

.speaking-page .speaking-topline,
.speaking-step .speaking-topline {
  animation-delay: 60ms;
}

.speaking-page .speaking-play-audio,
.speaking-page .speaking-english-card,
.speaking-page .speaking-chinese-card,
.speaking-step .speaking-play-audio,
.speaking-step .speaking-english-card,
.speaking-step .speaking-chinese-card {
  animation-delay: 120ms;
}

.speaking-page .speaking-record-button,
.speaking-step .speaking-record-button {
  animation-delay: 160ms;
}

.speaking-page .speaking-recognition,
.speaking-step .speaking-recognition {
  animation-delay: 200ms;
}

.speaking-page .speaking-feedback-row,
.speaking-step .speaking-feedback-row {
  animation-delay: 240ms;
}

.speaking-page .speaking-feedback.is-correct,
.speaking-page .speaking-feedback.is-wrong,
.speaking-step .speaking-feedback.is-correct,
.speaking-step .speaking-feedback.is-wrong {
  animation: speakingFeedbackEnter 180ms ease-out both;
}

@keyframes speakingCardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes speakingCardNavigate {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.speaking-practice-shell.is-navigating {
  animation: speakingCardNavigate 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes speakingLayerEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes speakingFeedbackEnter {
  from {
    opacity: 0.72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes speakingPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(180, 35, 24, 0);
  }
}

@media (max-width: 640px) {
  .speaking-mode-bar {
    flex-wrap: wrap;
  }

  .speaking-mode-shell {
    padding: 12px 16px;
  }

  .speaking-practice-shell {
    padding: 20px;
  }

  .speaking-practice-row {
    display: grid;
    justify-items: center;
  }

  .speaking-card-progress {
    position: static;
    flex-wrap: wrap;
    margin: -6px 0 0;
  }

  .speaking-done-list {
    flex: 1 1 auto;
  }

  .listening-done-list {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
    margin-top: 12px;
  }

  .speaking-prompt h1 {
    font-size: 22px;
  }

  .speaking-chinese-text,
  .speaking-english-text {
    font-size: 22px;
  }

  .speaking-record-row {
    width: 100%;
  }

  .speaking-record-button {
    flex: 1;
    justify-content: center;
  }

  .speaking-feedback-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .speaking-page .speaking-mode-shell,
  .speaking-page .speaking-practice-shell,
  .speaking-page .speaking-mode-bar,
  .speaking-page .speaking-topline,
  .speaking-page .speaking-play-audio,
  .speaking-page .speaking-english-card,
  .speaking-page .speaking-chinese-card,
  .speaking-page .speaking-record-button,
  .speaking-page .speaking-recognition,
  .speaking-page .speaking-feedback-row,
  .speaking-step .speaking-mode-shell,
  .speaking-step .speaking-practice-shell,
  .speaking-step .speaking-mode-bar,
  .speaking-step .speaking-topline,
  .speaking-step .speaking-play-audio,
  .speaking-step .speaking-english-card,
  .speaking-step .speaking-chinese-card,
  .speaking-step .speaking-record-button,
  .speaking-step .speaking-recognition,
  .speaking-step .speaking-feedback-row {
    animation: none;
  }

  .speaking-record-button.is-recording {
    animation: none;
  }
}

/* ---- 答题共创弹窗 ---- */
.answer-assist-modal[hidden],
.answer-assist-modal .answer-assist-modal-loading[hidden],
.answer-assist-modal .answer-assist-modal-content[hidden],
.answer-assist-modal .answer-assist-modal-footer[hidden],
.answer-assist-modal .answer-assist-custom-row[hidden],
.answer-assist-modal .answer-assist-multi-confirm[hidden],
.answer-assist-modal .answer-assist-compose[hidden] {
  display: none;
}

.answer-assist-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 100%);
  min-height: 460px;
  padding: 0;
  overflow: hidden;
}

.answer-assist-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.answer-assist-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.answer-assist-modal-loading {
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 12px 22px 20px;
  color: var(--muted);
}

/* 复用智能生卡 workshop 动画（workshop-breathe / workshop-float / workshop-card-float / workshop-spark） */
.answer-assist-loading-stage {
  --workshop-orange: #e78335;
  --workshop-purple: #7656b5;
  position: relative;
  width: min(340px, 88%);
  height: 232px;
  display: grid;
  place-items: center;
}

.answer-assist-loading-orbit {
  position: absolute;
  inset: 26px 28px 20px;
  border: 2px dashed var(--workshop-orange);
  border-radius: 50%;
  transform: rotate(-8deg);
  animation: workshop-breathe 3.2s ease-in-out infinite;
}

.answer-assist-loading-orbit::after {
  position: absolute;
  inset: 14px -11px -11px 13px;
  border: 2px dashed var(--workshop-purple);
  border-radius: 50%;
  content: "";
  transform: rotate(17deg);
}

.answer-assist-loading-teacher {
  position: relative;
  z-index: 2;
  width: 144px;
  height: 205px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(32, 32, 30, .08));
  animation: workshop-float 3s ease-in-out infinite;
}

.answer-assist-loading-card {
  position: absolute;
  z-index: 3;
  width: 82px;
  height: 53px;
  padding: 10px;
  border: 1px solid #d8d8d1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(32, 32, 30, .1);
  animation: workshop-card-float 2.8s ease-in-out infinite;
}

.answer-assist-loading-card::before,
.answer-assist-loading-card::after {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: #20201e;
  content: "";
}

.answer-assist-loading-card::after {
  width: 65%;
  margin-top: 8px;
  background: #c8c8c1;
}

.answer-assist-loading-card.is-orange {
  top: 16px;
  right: 0;
  border-top: 3px solid var(--workshop-orange);
  transform: rotate(6deg);
}

.answer-assist-loading-card.is-purple {
  bottom: 12px;
  left: 0;
  border-top: 3px solid var(--workshop-purple);
  transform: rotate(-7deg);
  animation-delay: -.9s;
}

.answer-assist-loading-spark {
  position: absolute;
  z-index: 4;
  color: var(--workshop-purple);
  font-size: 20px;
  line-height: 1;
  animation: workshop-spark 2.4s ease-in-out infinite;
}

.answer-assist-loading-spark.is-one { top: 6px; left: 62px; }

.answer-assist-loading-spark.is-two {
  right: 44px;
  bottom: 18px;
  color: var(--workshop-orange);
  font-size: 12px;
  animation-delay: -.8s;
}

@media (prefers-reduced-motion: reduce) {
  .answer-assist-loading-orbit,
  .answer-assist-loading-teacher,
  .answer-assist-loading-card,
  .answer-assist-loading-spark {
    animation: none !important;
  }
}

.answer-assist-modal-content {
  padding: 20px 22px 16px;
  overflow-y: auto;
}

.answer-assist-question {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
}

.answer-assist-options {
  display: grid;
  gap: 8px;
}

.answer-assist-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 9px 13px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.answer-assist-option:hover {
  border-color: var(--line-dark);
  background: var(--surface-soft);
}

.answer-assist-option.selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.answer-assist-option.skipped {
  opacity: .45;
}

.answer-assist-option-code {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.answer-assist-option.selected .answer-assist-option-code {
  color: var(--surface);
  background: var(--primary);
}

.answer-assist-custom-toggle {
  margin-top: 10px;
}

.answer-assist-custom-toggle.skipped {
  opacity: 1;
  border-color: var(--primary);
}

.answer-assist-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.answer-assist-custom-row .control {
  min-width: 0;
}

.answer-assist-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 66px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.answer-assist-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 760px) {
  .answer-assist-modal-card {
    width: 100%;
    min-height: min(560px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
  }

  .answer-assist-modal-content {
    padding: 18px 18px 14px;
  }

  .answer-assist-question {
    font-size: 17px;
  }
}

/* ── 智能生卡（内联模块） ─────────────────────────────── */

.smart-card-backdrop {
  z-index: 70;
}

#smartCardModal .smart-card-modal-card {
  overflow: visible;
}

#smartCardModal .sc-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#smartCardModal .llm-node-switch {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
}

#smartCardModal .llm-node-panel {
  z-index: 30;
}

#smartCardModal .sc-entry {
  display: grid;
  gap: 12px;
}

#smartCardModal .sc-generation-settings {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  align-items: start;
}

#smartCardModal .number-setting {
  display: grid;
  gap: 7px;
  color: var(--muted, #666);
  font-size: 12px;
}

#smartCardModal .setting-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink, #30302d);
  font-size: 13px;
  font-weight: 650;
}

#smartCardModal .setting-help {
  position: relative;
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line, #cecec7);
  border-radius: 50%;
  color: var(--muted, #777);
  background: var(--surface-soft, #f8f8f5);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

#smartCardModal .setting-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 40;
  width: max-content;
  max-width: 250px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #fff;
  background: #292927;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity .15s ease, transform .15s ease;
}

#smartCardModal .setting-help:hover::after,
#smartCardModal .setting-help:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

#smartCardModal .number-setting input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line, #d8d8d1);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--ink, #20201e);
  font: inherit;
}

#smartCardModal .stepper-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

#smartCardModal .stepper-btn {
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line, #d8d8d1);
  border-radius: 999px;
  color: var(--muted, #555);
  background: var(--surface-soft, #f6f6f2);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

#smartCardModal .stepper-btn:hover {
  border-color: var(--ink, #20201e);
  color: var(--ink, #20201e);
  background: var(--surface, #fff);
}

#smartCardModal .settings-error {
  min-height: 18px;
  color: #b63b32;
  font-size: 12px;
}

#smartCardModal .generate-button {
  justify-self: end;
  min-height: 40px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--ink, #20201e);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

#smartCardModal .generate-button:hover { filter: brightness(1.15); }

#smartCardModal .generate-button:disabled {
  color: #aaa;
  background: #dfdfda;
  cursor: wait;
}

/* 结果区：填满外层卡片，替代原 iframe 内层弹窗 */
#smartCardModal .sc-stage-modal {
  position: static;
  inset: auto;
  z-index: auto;
  padding: 0;
  display: block;
  background: transparent;
  backdrop-filter: none;
}

#smartCardModal .sc-stage-modal[hidden] { display: none; }

#smartCardModal .dialog {
  width: 100%;
  max-height: none;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#smartCardModal .dialog-header {
  position: static;
  padding: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  backdrop-filter: none;
}

#smartCardModal .dialog-title {
  margin: 0;
  font-size: 16px;
}

#smartCardModal .dialog-body {
  padding: 0;
}

#smartCardModal .smart-card-modal-card[data-view="expanded"] { width: min(820px, 100%); }
#smartCardModal .smart-card-modal-card[data-view="working"] { width: min(420px, 100%); }
#smartCardModal .smart-card-modal-card[data-view="reader"] { width: min(600px, 100%); }
#smartCardModal .smart-card-modal-card { transition: width 220ms ease; }

#smartCardModal .close-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--muted, #666);
  background: var(--surface-soft, #f0f0ed);
  font-size: 20px;
  cursor: pointer;
}

/* 提取自生卡 demo 的卡片/工作坊/跟读样式 */
#smartCardModal /* 完成庆祝 + 逐卡跟读 */
  .reader-view { display: flex; flex-direction: column; overflow: hidden; }

#smartCardModal .reader-view-in { animation: readerViewIn 260ms ease both; }

@keyframes readerViewIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }

#smartCardModal .reader-celebrate {
    position: relative;
    align-items: center;
    justify-content: center;
    margin: -4px -22px -22px;
    padding: 56px 24px 60px;
    border-radius: 0 0 20px 20px;
    background:
      radial-gradient(420px 300px at 12% 8%, rgba(255, 209, 92, 0.28), transparent 70%),
      radial-gradient(460px 340px at 88% 92%, rgba(134, 198, 167, 0.30), transparent 70%),
      #fff;
  }

#smartCardModal .reader-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    pointer-events: none;
    animation: readerGlowFloat 7s ease-in-out infinite;
  }

#smartCardModal .reader-glow-a { width: 260px; height: 260px; background: #ffe9a8; top: -70px; left: -50px; }

#smartCardModal .reader-glow-b { width: 240px; height: 240px; background: #bfe6d2; bottom: -70px; right: -40px; animation-delay: -3.5s; }

@keyframes readerGlowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(18px); }
  }

#smartCardModal .reader-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }

#smartCardModal .reader-confetti-piece {
    position: absolute;
    top: -14px;
    border-radius: 2px;
    opacity: 0;
    animation: readerConfettiFall linear forwards;
  }

@keyframes readerConfettiFall {
    0% { opacity: 0; transform: translateY(0) rotate(0deg); }
    8% { opacity: 1; }
    100% { opacity: 0.85; transform: translateY(560px) rotate(560deg); }
  }

#smartCardModal .reader-celebrate-center {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 18px;
    text-align: center;
  }

#smartCardModal .reader-badge-circle {
    stroke-dasharray: 183;
    stroke-dashoffset: 183;
    animation: readerDrawStroke 700ms ease-out 150ms forwards;
  }

#smartCardModal .reader-badge-check {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: readerDrawStroke 420ms ease-out 700ms forwards;
  }

@keyframes readerDrawStroke { to { stroke-dashoffset: 0; } }

#smartCardModal .reader-celebrate-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

#smartCardModal .reader-stats {
    display: flex;
    align-items: flex-start;
    gap: clamp(28px, 7vw, 56px);
    margin-top: 4px;
  }

#smartCardModal .reader-stat { display: grid; justify-items: center; gap: 8px; }

#smartCardModal .reader-stat-num {
    font-size: clamp(46px, 8vw, 60px);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

#smartCardModal .reader-stat:nth-child(1) .reader-stat-num { color: #20201e; }

#smartCardModal .reader-stat:nth-child(2) .reader-stat-num { color: #0f6b46; }

#smartCardModal .reader-stat:nth-child(3) .reader-stat-num { color: #ff6a3d; }

#smartCardModal .reader-stat-label {
    color: #666660;
    font-size: 15px;
    font-weight: 650;
  }

#smartCardModal .reader-celebrate-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
  }

#smartCardModal .reader-celebrate-actions .confirm-button,
#smartCardModal .reader-celebrate-actions .preview-action {
    min-height: 44px;
    padding: 12px 26px;
    border-radius: 999px;
    font-size: 15px;
  }

#smartCardModal .reader-celebrate-next {
    margin: 10px 0 0;
    color: #c9c9bf;
    font-size: 14px;
  }

#smartCardModal .reader-walkthrough { gap: 14px; padding-top: 4px; }

#smartCardModal .reader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

#smartCardModal .reader-guide { color: #666660; font-size: 15px; }

#smartCardModal .reader-progress {
    color: #c9c9bf;
    font-size: 14px;
    font-weight: 700;
    flex: 0 0 auto;
  }

#smartCardModal .reader-stage {
    min-height: 300px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 24px;
    text-align: center;
  }

#smartCardModal .reader-play {
    width: 86px;
    height: 86px;
    border: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(17, 17, 17, 0.20);
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

#smartCardModal .reader-play:hover { transform: scale(1.07); background: #000; }

#smartCardModal .reader-play:active { transform: scale(0.96); }

#smartCardModal .reader-play.is-playing { animation: readerPulseRing 1.6s ease-out infinite; }

@keyframes readerPulseRing {
    0% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.22); }
    100% { box-shadow: 0 0 0 26px rgba(17, 17, 17, 0); }
  }

#smartCardModal .reader-english {
    margin: 0;
    max-width: 520px;
    font-size: clamp(24px, 4.2vw, 32px);
    font-weight: 650;
    line-height: 1.6;
  }

#smartCardModal .reader-dots {
    display: flex;
    align-items: center;
    gap: 10px;
  }

#smartCardModal .reader-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #c9c9bf;
    opacity: 0.45;
    transition: background-color 200ms ease, opacity 200ms ease, transform 200ms ease;
  }

#smartCardModal .reader-dot.is-filled {
    background: #2f9d63;
    opacity: 1;
    transform: scale(1.15);
  }

#smartCardModal .reader-count {
    color: #c9c9bf;
    font-size: 14px;
    font-weight: 700;
  }

#smartCardModal .reader-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

#smartCardModal .reader-nav-hint {
    flex: 1;
    margin: 0;
    color: #c9c9bf;
    font-size: 14px;
    text-align: center;
  }

#smartCardModal .reader-nav-btn { min-width: 96px; }

#smartCardModal .reader-nav .confirm-button,
#smartCardModal .reader-nav .preview-action {
    min-height: 42px;
    border-radius: 999px;
    font-size: 15px;
  }

#smartCardModal .reader-nav-btn.is-callout { animation: readerCallout 1.4s ease-in-out infinite; }

@keyframes readerCallout {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
  }

#smartCardModal .generation-workshop {
    --workshop-orange: #e78335;
    --workshop-purple: #7656b5;
    min-height: 272px;
    padding: 0 12px;
    display: grid;
    place-items: center;
    text-align: center;
  }

#smartCardModal .workshop-content {
    width: min(470px, 100%);
    display: grid;
    justify-items: center;
  }

#smartCardModal .workshop-stage {
    position: relative;
    width: 245px;
    height: 160px;
    margin: 0 auto 2px;
    display: grid;
    place-items: center;
  }

#smartCardModal .workshop-orbit {
    position: absolute;
    inset: 18px 20px 14px;
    border: 2px dashed var(--workshop-orange);
    border-radius: 50%;
    transform: rotate(-8deg);
    animation: workshop-breathe 3.2s ease-in-out infinite;
  }

#smartCardModal .workshop-orbit::after {
    position: absolute;
    inset: 10px -8px -8px 9px;
    border: 2px dashed var(--workshop-purple);
    border-radius: 50%;
    content: "";
    transform: rotate(17deg);
  }

#smartCardModal .workshop-teacher {
    position: relative;
    z-index: 2;
    width: 108px;
    height: 154px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(32, 32, 30, .08));
    animation: workshop-float 3s ease-in-out infinite;
  }

#smartCardModal .workshop-card {
    position: absolute;
    z-index: 3;
    width: 68px;
    height: 44px;
    padding: 8px;
    border: 1px solid #d8d8d1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(32, 32, 30, .1);
    animation: workshop-card-float 2.8s ease-in-out infinite;
  }

#smartCardModal .workshop-card::before,
#smartCardModal .workshop-card::after {
    display: block;
    height: 4px;
    border-radius: 99px;
    background: #20201e;
    content: "";
  }

#smartCardModal .workshop-card::after {
    width: 65%;
    margin-top: 7px;
    background: #c8c8c1;
  }

#smartCardModal .workshop-card.is-orange {
    top: 15px;
    right: 1px;
    border-top: 3px solid var(--workshop-orange);
    transform: rotate(6deg);
  }

#smartCardModal .workshop-card.is-purple {
    bottom: 10px;
    left: 0;
    border-top: 3px solid var(--workshop-purple);
    transform: rotate(-7deg);
    animation-delay: -.9s;
  }

#smartCardModal .workshop-spark {
    position: absolute;
    z-index: 4;
    color: var(--workshop-purple);
    font-size: 18px;
    line-height: 1;
    animation: workshop-spark 2.4s ease-in-out infinite;
  }

#smartCardModal .workshop-spark.is-one { top: 5px; left: 50px; }

#smartCardModal .workshop-spark.is-two {
    right: 35px;
    bottom: 14px;
    color: var(--workshop-orange);
    font-size: 11px;
    animation-delay: -.8s;
  }

#smartCardModal .workshop-heading {
    margin: 2px 0 5px;
    color: #20201e;
    font-size: 23px;
    line-height: 1.35;
  }

#smartCardModal .workshop-description {
    margin: 0;
    color: #777770;
    font-size: 14px;
    line-height: 1.7;
  }

#smartCardModal .workshop-inputs {
    margin-top: 17px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
  }

#smartCardModal .workshop-input-tag {
    padding: 5px 9px;
    border: 1px solid #e0e0da;
    border-radius: 999px;
    color: #5f5f59;
    background: #fafaf7;
    font-size: 11px;
    font-weight: 650;
  }

#smartCardModal .workshop-process {
    min-height: 30px;
    margin-top: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    color: #9a9a93;
    font-size: 13px;
  }

#smartCardModal .workshop-process-step {
    padding: 4px 7px;
    border-radius: 999px;
    transition: color .24s ease, background-color .24s ease;
  }

#smartCardModal .workshop-process-step.is-current {
    color: #20201e;
    background: #eeeeea;
  }

#smartCardModal .workshop-process-dot { color: #c5c5be; }

#smartCardModal .workshop-hint {
    margin: 9px 0 0;
    color: #96968f;
    font-size: 11px;
  }

#smartCardModal .generation-workshop.is-failure .workshop-stage {
    display: none;
  }

#smartCardModal .generation-workshop.is-success .workshop-orbit,
#smartCardModal .generation-workshop.is-failure .workshop-orbit,
#smartCardModal .generation-workshop.is-success .workshop-teacher,
#smartCardModal .generation-workshop.is-failure .workshop-teacher,
#smartCardModal .generation-workshop.is-failure .workshop-card,
#smartCardModal .generation-workshop.is-success .workshop-spark,
#smartCardModal .generation-workshop.is-failure .workshop-spark {
    animation-play-state: paused;
  }

#smartCardModal .generation-workshop.is-success .workshop-card.is-orange {
    transform: translate(6px, -3px) rotate(8deg);
    animation: workshop-success-open-orange .48s ease-out both;
  }

#smartCardModal .generation-workshop.is-success .workshop-card.is-purple {
    transform: translate(-6px, 3px) rotate(-9deg);
    animation: workshop-success-open-purple .48s ease-out both;
  }

#smartCardModal .workshop-status-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #47815c;
    font-size: 21px;
    font-weight: 800;
  }

#smartCardModal .workshop-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 9px;
  }

#smartCardModal .workshop-action {
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid #d7d7d0;
    border-radius: 7px;
    color: #454540;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

#smartCardModal .workshop-action.is-primary {
    color: #fff;
    border-color: #20201e;
    background: #20201e;
  }

@keyframes workshop-float {
    0%, 100% { transform: translateY(2px); }
    50% { transform: translateY(-4px); }
  }

@keyframes workshop-card-float {
    0%, 100% { margin-top: 2px; }
    50% { margin-top: -3px; }
  }

@keyframes workshop-breathe {
    0%, 100% { opacity: .58; transform: rotate(-8deg) scale(.985); }
    50% { opacity: .95; transform: rotate(-8deg) scale(1.015); }
  }

@keyframes workshop-spark {
    0%, 100% { opacity: .35; transform: scale(.88); }
    50% { opacity: 1; transform: scale(1.08); }
  }

@keyframes workshop-success-open-orange {
    from { transform: translate(0, 0) rotate(4deg) scale(.96); }
    to { transform: translate(6px, -3px) rotate(8deg) scale(1); }
  }

@keyframes workshop-success-open-purple {
    from { transform: translate(0, 0) rotate(-4deg) scale(.96); }
    to { transform: translate(-6px, 3px) rotate(-9deg) scale(1); }
  }

#smartCardModal .dialog.is-card-detail .stage-toolbar {
    padding-right: 48px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

#smartCardModal .dialog.is-card-detail .corpus-card-meta,
#smartCardModal .dialog.is-card-detail .stage-nav {
    flex-wrap: wrap;
  }

#smartCardModal .dialog.is-card-detail .stage-content-scroll-layout {
    gap: 14px;
    padding-right: 4px;
  }

@media (max-width: 1100px) {
    .dialog.is-card-detail .audio-controls:not(.is-browser-tts) {
      grid-template-columns: 34px minmax(140px, 1fr) auto minmax(0, 1fr);
      row-gap: 8px;
      padding: 8px 10px;
    }
    .dialog.is-card-detail .audio-replay,
    .dialog.is-card-detail .audio-jump-group,
    .dialog.is-card-detail .audio-speed,
    .dialog.is-card-detail .audio-volume {
      grid-row: 2;
    }
    .dialog.is-card-detail .audio-jump-group {
      justify-self: start;
    }
    .dialog.is-card-detail .audio-volume input {
      max-width: none;
    }
  }

#smartCardModal .story-tree {
    display: grid;
    gap: 18px;
  }

#smartCardModal .story-branch {
    --tree-color: #56705d;
    --tree-soft: #eef4ef;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #deded7;
    border-radius: 10px;
    background: #fff;
  }

#smartCardModal .story-branch:nth-child(3n + 2) {
    --tree-color: #725fb3;
    --tree-soft: #f1effb;
  }

#smartCardModal .story-branch:nth-child(3n + 3) {
    --tree-color: #a85d32;
    --tree-soft: #fff2ea;
  }

#smartCardModal .story-node {
    min-width: 0;
    min-height: 52px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--tree-color);
    background: linear-gradient(90deg, var(--tree-soft), #fff 46%);
    cursor: pointer;
    list-style: none;
  }

#smartCardModal .story-node::-webkit-details-marker { display: none; }

#smartCardModal .story-node::after {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid var(--tree-color);
    border-bottom: 2px solid var(--tree-color);
    content: "";
    transform: rotate(45deg);
    transition: transform .16s ease;
  }

#smartCardModal .story-branch:not([open]) .story-node::after {
    transform: rotate(-45deg);
  }

#smartCardModal .story-kicker {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--tree-color);
    background: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
  }

#smartCardModal .story-topics {
    min-width: 0;
    height: 24px;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
  }

#smartCardModal .story-topics .preview-topic { flex: 0 0 auto; }

#smartCardModal .story-node h2 {
    min-width: 0;
    flex: 0 1 auto;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

#smartCardModal .story-meta {
    flex: 0 0 auto;
    margin-left: auto;
    color: #777770;
    font-size: 11px;
    white-space: nowrap;
  }

#smartCardModal .story-card-list {
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

#smartCardModal .story-card-node {
    position: relative;
    min-width: 0;
    border-bottom: 1px solid #ecece6;
  }

#smartCardModal .story-card-node:last-child { border-bottom: 0; }

#smartCardModal .story-card-empty {
    position: relative;
    min-height: 58px;
    padding: 18px 18px 18px 28px;
    color: #777770;
    background: #fafaf7;
    font-size: 12px;
  }

#smartCardModal .story-tree-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed #d7d7d0;
    border-radius: 8px;
    color: #777770;
    background: #fafaf7;
    font-size: 12px;
  }

#smartCardModal .story-card-order {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--tree-color);
    background: var(--tree-soft);
    font-size: 11px;
    font-weight: 800;
  }

#smartCardModal .card-preview {
    --topic-color: #37533e;
    --topic-bg: #e6f0e8;
    min-width: 0;
    min-height: 58px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: inherit;
    background: transparent;
    text-align: left;
    transition: background-color .16s ease;
  }

#smartCardModal .card-preview[data-topic="Basketball"] {
    --topic-color: #a64b00;
    --topic-bg: #fff0de;
  }

#smartCardModal .card-preview[data-topic="Movies"] {
    --topic-color: #6541a5;
    --topic-bg: #f1ecff;
  }

#smartCardModal .card-preview[data-topic="Travel"] {
    --topic-color: #23638f;
    --topic-bg: #e8f4ff;
  }

#smartCardModal .card-preview:hover {
    background: #fafaf7;
  }

#smartCardModal .preview-card-toggle {
    grid-column: 1 / 3;
    min-width: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

#smartCardModal .preview-card-toggle:focus-visible {
    outline: 2px solid var(--tree-color);
    outline-offset: 4px;
    border-radius: 4px;
  }

#smartCardModal .preview-topic {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--topic-color);
    background: var(--topic-bg);
    font-size: 11px;
    font-weight: 700;
  }

#smartCardModal .preview-question {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
  }

#smartCardModal .preview-answer-zh {
    grid-column: 1 / -1;
    margin: 0;
    padding: 11px 12px;
    border-left: 3px solid var(--tree-color);
    border-radius: 0 6px 6px 0;
    color: #4f4f49;
    background: #f7f7f3;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
  }

#smartCardModal .preview-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

#smartCardModal .preview-action,
#smartCardModal .preview-link,
#smartCardModal .confirm-button {
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid #d9d9d2;
    border-radius: 6px;
    color: #454540;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
  }

#smartCardModal .preview-link,
#smartCardModal .confirm-button {
    color: #fff;
    border-color: #20201e;
    background: #20201e;
  }

#smartCardModal .preview-action.is-danger {
    color: #9c3029;
    border-color: #e5c7c3;
    background: #fff8f7;
  }

#smartCardModal .preview-action.is-regenerate {
    color: #315d3c;
    border-color: #b9d1bf;
    background: #f1f7f2;
  }

#smartCardModal .preview-action:hover { filter: brightness(.97); }

#smartCardModal .preview-link:hover { background: #343431; }

#smartCardModal .preview-action:disabled,
#smartCardModal .preview-link:disabled,
#smartCardModal .confirm-button:disabled { opacity: .5; cursor: wait; }

#smartCardModal .preview-actions-bar {
    flex: 0 0 auto;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8e8e2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

#smartCardModal .preview-scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

#smartCardModal .preview-status {
    min-height: 20px;
    color: #666660;
    font-size: 12px;
  }

#smartCardModal .preview-status.is-error { color: #b63b32; }

#smartCardModal body.is-embedded .story-tree,
#smartCardModal body.is-embedded .preview-actions-bar {
    margin-inline: 12px;
  }

#smartCardModal .audio-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    background: rgba(32, 32, 30, .94);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

#smartCardModal .audio-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

@media (max-width: 620px) {
    .generation-workshop { min-height: 272px; padding: 0 8px; }
    .workshop-stage {
      width: 245px;
      height: 160px;
    }
    .workshop-teacher {
      width: 108px;
      height: 154px;
    }
    .story-node {
      align-items: center;
      flex-wrap: nowrap;
    }
    .story-node h2 { flex: 0 1 auto; }
    .story-meta {
      width: auto;
      margin-left: auto;
      padding-left: 0;
    }
    .card-preview {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .preview-card-toggle {
      grid-column: 1 / -1;
    }
    .preview-topic {
      justify-self: start;
    }
    .preview-footer {
      grid-column: 1 / -1;
    }
    .preview-actions-bar { align-items: stretch; flex-direction: column; }
  }

@media (prefers-reduced-motion: reduce) {
    .workshop-orbit,
    .workshop-teacher,
    .workshop-card,
    .workshop-spark {
      animation: none !important;
    }
    .workshop-process-step {
      transition: none;
    }
  }

#smartCardModal .profile-update-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5c5c56;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

#smartCardModal .profile-update-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #20201e;
  cursor: pointer;
}
