:root {
  --bg: #f3ebdc;
  --surface: rgba(255, 250, 243, 0.9);
  --surface-strong: #fffdf8;
  --ink: #18212d;
  --muted: #5d6775;
  --accent: #d95a35;
  --accent-deep: #b44928;
  --teal: #0f6d67;
  --teal-soft: rgba(15, 109, 103, 0.12);
  --line: rgba(24, 33, 45, 0.08);
  --shadow: 0 20px 48px rgba(65, 44, 21, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 90, 53, 0.22), transparent 24%),
    radial-gradient(circle at 90% 10%, rgba(15, 109, 103, 0.16), transparent 22%),
    linear-gradient(180deg, #f8f1e6 0%, #efe2cc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 92%);
}

button,
input,
textarea {
  font: inherit;
}

#app {
  min-height: 100vh;
}

.page-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 14px auto 40px;
}

.page-shell-product {
  padding-bottom: 12px;
}

.topbar,
.hero-panel,
.content-grid,
.feature-grid,
.auth-layout,
.stat-grid,
.metric-strip,
.mini-grid,
.card-actions,
.top-actions,
.trend-row,
.score-row,
.skill-switcher,
.card-row,
.editor-grid,
.editor-stack,
.editor-section-block,
.editor-skill-group,
.quality-summary-row {
  display: grid;
  gap: 18px;
}

.card-row.spread {
  grid-auto-flow: column;
  justify-content: space-between;
  align-items: center;
}

.topbar {
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 28px;
  background: rgba(255, 250, 243, 0.76);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
}

.brand p,
.brand span,
.pill,
.eyebrow,
.source-tag,
.tiny-note,
.flash,
small,
legend {
  margin: 0;
}

.brand p,
h1,
h2,
h3,
strong,
.primary-btn,
.ghost-btn,
.nav-action {
  font-family: "Outfit", sans-serif;
}

.brand p {
  font-size: 1.04rem;
  font-weight: 700;
}

.brand span,
.hero-text,
p,
label,
li,
small,
.source-tag,
.tiny-note,
.flash,
legend,
textarea::placeholder {
  color: var(--muted);
}

.top-actions {
  grid-auto-flow: column;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.card.dark {
  background: #1b2330;
  color: #fff;
}

.card.dark span,
.card.dark p {
  color: rgba(255, 255, 255, 0.76);
}

.jumbo {
  padding: 30px;
}

.compact {
  min-height: 150px;
}

.hero-panel,
.auth-layout {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}

.hero-copy,
.hero-side,
.auth-copy,
.auth-forms,
.stacked-form,
.score-stack,
.side-plan,
.intro-card,
.dashboard-hero {
  display: grid;
  gap: 16px;
}

.eyebrow,
.pill {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(217, 90, 53, 0.12);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.pill-ready {
  background: rgba(15, 109, 103, 0.12);
  color: var(--teal);
}

.pill-success {
  background: rgba(24, 33, 45, 0.12);
  color: var(--ink);
}

.pill-alert {
  background: rgba(217, 90, 53, 0.12);
  color: var(--accent-deep);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.05;
}

h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

p {
  margin: 0;
  line-height: 1.75;
}

.hero-text {
  max-width: 58ch;
  font-size: 1.03rem;
}

.hero-actions,
.card-actions,
.score-row,
.skill-switcher {
  grid-auto-flow: column;
  justify-content: start;
}

.nav-action,
.primary-btn,
.ghost-btn,
.score-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.nav-action:hover,
.primary-btn:hover,
.ghost-btn:hover,
.score-chip:hover {
  transform: translateY(-1px);
}

.nav-action:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.score-chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.nav-action:disabled,
.primary-btn:disabled,
.ghost-btn:disabled,
.score-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.nav-action,
.primary-btn,
.ghost-btn.filled,
.score-chip {
  background: var(--accent);
  color: #fff;
}

.nav-action.subtle,
.ghost-btn {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.score-chip {
  padding-inline: 14px;
  background: var(--teal);
}

.feature-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.feature-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.content-grid.wide-right {
  grid-template-columns: 1.2fr 0.8fr;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  text-align: center;
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 4px;
}

.metric-strip,
.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-section-head {
  margin-top: 22px;
  align-items: end;
}

.landing-section-head h2 {
  margin-top: 6px;
}

.scenario-study-grid {
  align-items: start;
}

.flow-strip,
.option-stack,
.challenge-summary {
  display: grid;
  gap: 12px;
}

.flow-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
}

.flow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(24, 33, 45, 0.08);
  font-weight: 700;
}

.flow-step.active {
  background: rgba(217, 90, 53, 0.12);
  border-color: rgba(217, 90, 53, 0.2);
}

.flow-step.done {
  background: rgba(15, 109, 103, 0.1);
  border-color: rgba(15, 109, 103, 0.16);
}

.option-btn {
  text-align: left;
  border-radius: 18px;
}

.challenge-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.challenge-summary > div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

.challenge-summary strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.vocab-focus-card,
.interactive-task-card,
.vocab-rail-card,
.interactive-panel,
.stacked-answer {
  display: grid;
  gap: 16px;
}

.vocab-focus-head {
  align-items: start;
}

.vocab-panel-switcher {
  grid-auto-flow: column;
  justify-content: start;
}

.vocab-panel-body {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

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

.interactive-panel {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 109, 103, 0.07);
  border: 1px solid rgba(15, 109, 103, 0.12);
}

.reward-panel {
  background: linear-gradient(135deg, rgba(217, 90, 53, 0.12), rgba(15, 109, 103, 0.08));
  border-color: rgba(217, 90, 53, 0.18);
}

.stacked-answer span {
  font-weight: 700;
  color: var(--ink);
}

.scenario-teaser h3 {
  min-height: 2.7em;
}

.scenario-teaser small {
  display: block;
}

.metric-strip > div,
.mini-grid > article {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.metric-strip strong,
.score-stack strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.stacked-form label,
fieldset {
  display: grid;
  gap: 8px;
}

fieldset {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

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

.code-area {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.editor-grid.two-up-tight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.editor-block.compact-block {
  padding: 16px;
}

.editor-block.has-issues {
  border-color: rgba(217, 90, 53, 0.26);
  background: rgba(217, 90, 53, 0.05);
}

.editor-section-block {
  padding: 18px;
  border: 1px dashed rgba(24, 33, 45, 0.14);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.52);
}

.ghost-btn.mini,
.primary-btn.mini {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.ghost-btn.danger {
  border-color: rgba(217, 90, 53, 0.25);
  color: var(--accent-deep);
}

.field-shell.field-error {
  color: var(--accent-deep);
}

.field-shell.field-error input,
.field-shell.field-error textarea {
  border-color: rgba(217, 90, 53, 0.35);
  background: rgba(217, 90, 53, 0.04);
}

.field-targeted {
  outline: 3px solid rgba(15, 109, 103, 0.28);
  outline-offset: 4px;
  transition: outline-color 0.2s ease;
}

.issue-pill,
.quality-ok {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
}

.issue-pill {
  background: rgba(217, 90, 53, 0.12);
  color: var(--accent-deep);
}

.quality-ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.quality-summary-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.quality-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.source-quality-panel,
.source-metrics,
.source-action-list,
.source-action-item,
.source-action-buttons,
.snapshot-panel,
.snapshot-grid,
.priority-panel,
.priority-list,
.priority-item,
.priority-actions {
  display: grid;
  gap: 12px;
}

.source-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.snapshot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-action-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.source-action-buttons {
  grid-template-columns: repeat(auto-fit, minmax(88px, max-content));
  align-items: start;
}

.priority-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.priority-item strong {
  font-size: 0.98rem;
}

.priority-alert {
  border-color: rgba(217, 90, 53, 0.22);
  background: rgba(217, 90, 53, 0.06);
}

.priority-warn {
  border-color: rgba(190, 138, 39, 0.24);
  background: rgba(190, 138, 39, 0.08);
}

.priority-neutral {
  border-color: rgba(24, 33, 45, 0.1);
}

.priority-ok {
  border-color: rgba(15, 109, 103, 0.2);
  background: rgba(15, 109, 103, 0.06);
}

.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.issue-group {
  display: grid;
  gap: 10px;
}

.issue-group h4 {
  margin: 0;
  font-size: 1rem;
}

.issue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.bullet-list {
  padding-left: 18px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.compact-list {
  gap: 8px;
}

.source-tag,
.tiny-note {
  font-size: 0.92rem;
}

.status-shell {
  margin-bottom: 0;
}

.status-guidance {
  margin-top: -8px;
  padding: 10px 12px;
  border-radius: 14px;
}

.status-guidance-ok {
  background: rgba(15, 109, 103, 0.08);
  color: var(--teal);
}

.status-guidance-alert {
  background: rgba(217, 90, 53, 0.08);
  color: var(--accent-deep);
}

.source-risk-note {
  color: var(--accent-deep);
}

.source-risk-ok {
  color: var(--teal);
}

.flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.flash.success {
  border-color: rgba(15, 109, 103, 0.2);
  background: rgba(15, 109, 103, 0.08);
}

.flash.error {
  border-color: rgba(217, 90, 53, 0.2);
  background: rgba(217, 90, 53, 0.08);
}

.trend-row {
  grid-auto-flow: column;
  align-items: end;
  min-height: 180px;
}

.trend-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.trend-bar span {
  width: 32px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--teal), #59b9ac);
}

.trend-bar small {
  font-size: 0.78rem;
}

.vocab-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.review-card,
.scenario-card,
.scenario-teaser {
  min-height: 220px;
}

@media (max-width: 1024px) {
  .hero-panel,
  .auth-layout,
  .content-grid,
  .content-grid.wide-right,
  .feature-grid.three-up,
  .feature-grid.two-up,
  .stat-grid,
  .metric-strip,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .card-actions,
  .top-actions,
  .score-row,
  .skill-switcher,
  .trend-row {
    grid-auto-flow: row;
  }

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

  .editor-grid.two-up-tight {
    grid-template-columns: 1fr;
  }

  .quality-summary-row {
    grid-template-columns: 1fr;
  }

  .flow-strip {
    grid-template-columns: 1fr 1fr;
  }

  .challenge-summary {
    grid-template-columns: 1fr;
  }

  .source-metrics {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 16px, 100%);
    margin: 8px auto 24px;
  }

  .topbar,
  .card,
  .jumbo {
    padding: 18px;
    border-radius: 20px;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }
}

/* ---- 全局加载条 ---- */
.loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: transparent;
  overflow: hidden;
}

.loader-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--teal), var(--accent));
  animation: loaderSlide 1.4s ease-in-out infinite;
  background-size: 200% 100%;
}

.loader-bar-done .loader-bar-fill {
  animation: loaderFadeOut 0.3s ease-out forwards;
}

@keyframes loaderSlide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes loaderFadeOut {
  to { opacity: 0; }
}

/* ---- 例句面板 ---- */
.example-card {
  padding: 16px;
  margin: 12px 0;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.example-card .context-badge {
  display: inline-block;
  margin-bottom: 8px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.example-text {
  font-size: 1rem;
  line-height: 1.6;
  margin: 8px 0;
  color: var(--text-primary);
}

.example-translation {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.example-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
}

.example-nav .example-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

.example-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- 编辑端例句编辑器 ---- */
.example-editor-section {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.example-editor-section > label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.example-editor-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.example-editor-row .example-row-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.example-editor-row textarea {
  min-height: 60px;
  resize: vertical;
}

.example-editor-row input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.example-editor-row select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ---- 文章列表页 ---- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.article-section {
  margin-bottom: 32px;
}

.article-section h2 {
  margin-bottom: 12px;
  font-size: 1.3rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  display: inline-block;
}

.article-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.article-detail .article-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0 24px;
  flex-wrap: wrap;
}

.article-detail .article-body {
  line-height: 1.8;
  font-size: 1rem;
}

.article-detail .article-body h2 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.article-detail .article-body h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.article-detail .article-body p {
  margin-bottom: 12px;
}

.article-detail .article-body li {
  margin-left: 20px;
  margin-bottom: 6px;
}

.article-detail .article-body code {
  background: var(--bg-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---- 语言点面板 ---- */
.language-points-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.language-point-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--bg-muted);
}

.language-point-item summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.language-point-item summary::-webkit-details-marker { display: none; }

.language-point-item summary::before {
  content: '▶';
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.8rem;
}

.language-point-item[open] summary::before {
  transform: rotate(90deg);
}

.lp-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.lp-example {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.lp-correct { color: #16a34a; font-weight: 500; }
.lp-incorrect { color: #dc2626; text-decoration: line-through; }
.lp-explanation { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }
.lp-mistake { font-size: 0.9rem; color: #ea580c; margin-top: 8px; }

.lp-type-grammar { background: #3b82f6; color: white; }
.lp-type-pronunciation { background: #8b5cf6; color: white; }
.lp-type-strategy { background: #10b981; color: white; }
.lp-type-sentence-pattern { background: #f59e0b; color: white; }

/* ---- 朗读按钮 ---- */
.speak-btn {
  margin-top: 8px;
  font-size: 0.85rem;
  padding: 4px 12px;
}

.speak-btn:hover {
  background: var(--accent);
  color: white;
}

/* ---- 例句行布局 ---- */
.example-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.example-speak-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 1rem;
  margin-top: 4px;
}

/* ---- Band tabs (难度分层) ---- */
.band-tabs {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.band-tab {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.band-tab:hover:not(.locked):not(.active) {
  border-color: var(--accent);
  background: var(--accent-light, #fff7ed);
}

.band-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.band-tab.active small,
.band-tab.active .band-progress {
  color: rgba(255,255,255,0.85);
}

.band-tab.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.band-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 10px;
  flex-shrink: 0;
}

.band-tab.active .band-icon {
  background: rgba(255,255,255,0.2);
}

.band-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.band-tab-text strong {
  font-size: 1rem;
}

.band-tab-text small {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.band-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

.band-progress.done {
  color: var(--success, #16a34a);
}

.band-tab.active .band-progress,
.band-tab.active .band-progress.done {
  color: white;
}

/* ---- Recommend badge ---- */
.recommend-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---- Scenario completion state ---- */
.scenario-completed {
  opacity: 0.75;
  border-left: 3px solid var(--success, #16a34a);
}

.scenario-completed h3::after {
  content: " ✓";
  color: var(--success, #16a34a);
  font-size: 0.85rem;
}

/* ---- Listening (Task 1.2) ---- */
.listening-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.listening-instruction {
  color: var(--muted);
  font-size: 0.9rem;
}

.listening-transcript-preview,
.listening-questions-preview {
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 8px;
}

.listening-transcript-preview h3,
.listening-questions-preview h3 {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.listening-questions-preview ol {
  padding-left: 20px;
}

.audio-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.audio-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.play-btn {
  background: var(--accent);
  color: white;
}

.play-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.listening-question {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.listening-question h3 {
  font-size: 0.85rem;
  color: var(--accent);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-option:hover {
  border-color: var(--accent);
}

.radio-option.selected {
  border-color: var(--accent);
  background: #fff7ed;
}

.radio-option input[type="radio"] {
  accent-color: var(--accent);
}

.match-pairs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-item {
  min-width: 180px;
  font-weight: 600;
}

.match-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.listening-score-bar {
  position: relative;
  height: 32px;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
}

.score-meter {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width 0.6s ease;
  border-radius: 16px;
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.85rem;
}

.listening-review-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.listening-review-list li.correct {
  color: var(--success, #16a34a);
}

.listening-review-list li.incorrect {
  color: #dc2626;
}

/* ---- Diagnostic (Task 1.3) ---- */
.diagnostic-result {
  text-align: center;
}

.diagnostic-score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 24px auto;
}

.diagnostic-score-circle .score-number {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 800;
}

.diagnostic-score-circle .score-percent {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  color: var(--muted);
}

.diagnostic-desc {
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 16px;
  color: var(--muted);
}

.diagnostic-instruction {
  color: var(--muted);
  font-size: 0.9rem;
}

.diagnostic-progress {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.diagnostic-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-bar-row {
  align-items: center;
  gap: 12px;
}

.diagnostic-questions {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.diagnostic-question {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.diagnostic-question:last-child {
  border-bottom: none;
}

.diagnostic-question.answered {
  background: #f0fdf4;
  margin: 0 -12px;
  padding: 12px;
  border-radius: 8px;
  border-bottom: none;
}

.option-btn.full {
  text-align: left;
  white-space: normal;
  line-height: 1.5;
}

.option-btn.selected {
  border-color: var(--accent);
  background: #fff7ed;
  font-weight: 600;
}

.tab-btn {
  font-size: 0.85rem;
  padding: 6px 14px;
}

.tab-btn.done {
  color: var(--success, #16a34a);
}

/* ---- Speaking (Task 1.4) ---- */
.speaking-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speaking-instruction {
  color: var(--muted);
  font-size: 0.9rem;
}

.speaking-prompt {
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
}

.speaking-prompt h3 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.speaking-q {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.speaking-prompt.part2 {
  border: 2px solid var(--accent);
}

.recorder-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.record-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent);
  color: white;
  transition: all 0.2s;
}

.record-btn.recording {
  background: #dc2626;
  animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.record-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.self-assessment {
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
}

.self-assessment h3 {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.assessment-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assessment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.star-row {
  display: flex;
  gap: 4px;
}

.star {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #d1d5db;
  padding: 0 2px;
  transition: color 0.2s;
}

.star.active {
  color: #f59e0b;
}

.recorder-fallback {
  padding: 12px 16px;
  background: #fef3c7;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.9rem;
}

/* === Reading === */
.reading-card .reading-passage-text {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 12px 0;
  font-size: 0.95rem;
  line-height: 1.75;
  max-height: 400px;
  overflow-y: auto;
  color: #374151;
}

.reading-card .questions-preview {
  margin-top: 16px;
  padding: 12px 16px;
  background: #eff6ff;
  border-radius: 8px;
}

.reading-card .questions-preview h3 {
  font-size: 0.9rem;
  color: #1e40af;
  margin-bottom: 8px;
}

/* === Writing === */
.writing-card .writing-instruction {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.writing-card .writing-data {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.9rem;
}

.writing-card .writing-data h3 {
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 6px;
}

.writing-card .writing-prompt {
  margin: 12px 0;
}

.writing-card .writing-prompt h3 {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 6px;
}

.writing-card .writing-prompt p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #111827;
}

.writing-card .word-count {
  font-weight: 600;
}

.writing-card .word-count.met {
  color: #059669;
}

.writing-card .word-count.below {
  color: #dc2626;
}

.writing-card textarea {
  min-height: 200px;
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.6;
}

.model-answer-panel {
  margin-top: 16px;
}

.model-answer-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
  max-height: 500px;
  overflow-y: auto;
}

/* === Mock Test === */
.mock-timer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #1f2937;
  color: #fff;
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mock-timer-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.mock-timer-clock {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 70px;
}

.mock-progress-bar {
  display: flex;
  flex: 1;
  gap: 4px;
}

.mock-seg {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  background: #374151;
  color: #9ca3af;
  transition: all 0.2s;
}

.mock-seg.active {
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.mock-seg.done {
  background: #059669;
  color: #fff;
}

.mock-summary-stat {
  text-align: center;
  margin: 24px 0;
}

.score-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#059669 0% var(--score, 0%), #e5e7eb var(--score, 0%) 100%);
}

.ring-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  justify-content: center;
}

.ring-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
}

.ring-unit {
  font-size: 0.8rem;
  color: #6b7280;
}

.mock-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.mock-detail-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-detail-item strong {
  font-size: 0.9rem;
}

.mock-detail-item span {
  font-size: 0.85rem;
  color: #6b7280;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

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

/* === Progress View === */
.radar-canvas {
  display: block;
  margin: 0 auto;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #374151;
}

.radar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.progress-bar-full {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  margin: 16px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.scenario-chip {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.scenario-chip.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.scenario-chip strong {
  font-size: 0.9rem;
  color: #111827;
}

.scenario-chip small {
  font-size: 0.75rem;
  color: #6b7280;
}

.scenario-chip .chip-band {
  font-size: 0.7rem;
  color: #6b7280;
  text-transform: uppercase;
}

.scenario-chip.done .chip-band {
  color: #059669;
}

/* === Error Notebook === */
.error-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.error-item {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 14px 18px;
}

.error-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.error-prompt {
  font-size: 0.95rem;
  color: #111827;
  margin-bottom: 8px;
  line-height: 1.5;
}

.error-answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

.error-user {
  color: #dc2626;
}

.error-correct {
  color: #059669;
}

/* === Output Feedback Panel === */
.output-feedback-panel {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.output-feedback-panel h3 {
  font-size: 1rem;
  color: #166534;
  margin-bottom: 12px;
}

.output-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.output-col {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
}

.output-col strong {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.output-col p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #111827;
}

.output-col.model {
  border-color: #a7f3d0;
  background: #f9fefb;
}

.output-col.your {
  border-color: #fde68a;
  background: #fffef9;
}

.output-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hint-badge {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.hint-badge.ok {
  background: #ecfdf5;
  color: #065f46;
}

.hint-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.hint-badge em {
  font-weight: 600;
  font-style: normal;
  color: #1e40af;
}

.output-tip {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #6b7280;
}

/* === Back Button === */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.back-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.back-btn:active {
  background: #e5e7eb;
}

/* === Accent Toggle === */
.accent-toggle {
  font-weight: 500;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.accent-toggle:hover {
  background: #dbeafe;
}

/* ========== Quiz Summary / 小测回顾 ========== */

.quiz-summary-card {
  max-width: 680px;
  margin: 0 auto;
}

.quiz-review-list {
  margin: var(--gap) 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-half);
}

.quiz-review-item {
  display: flex;
  gap: var(--gap-half);
  padding: var(--gap-half);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  align-items: flex-start;
}

.quiz-review-item.correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.quiz-review-item.wrong {
  border-color: #fecaca;
  background: #fef2f2;
}

.review-icon {
  font-size: 1.2rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.quiz-review-item.correct .review-icon {
  color: #16a34a;
  background: #dcfce7;
}

.quiz-review-item.wrong .review-icon {
  color: #dc2626;
  background: #fee2e2;
}

.review-body {
  flex: 1;
  min-width: 0;
}

.review-prompt {
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}

.review-detail {
  font-size: 0.9rem;
  color: var(--muted);
}
