:root {
  --bg: #f3efe7;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: #fffdf8;
  --ink: #1a2533;
  --muted: #56606f;
  --line: rgba(29, 41, 57, 0.13);
  --line-strong: rgba(29, 41, 57, 0.28);
  --warm: #c5552f;
  --warm-soft: #ffe3d8;
  --cool: #0f6b78;
  --cool-soft: #d9f0f1;
  --dark: #16303d;
  --gold: #ffcb77;
  --good: #177245;
  --bad: #aa2d31;
  --shadow: 0 24px 60px rgba(23, 35, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 203, 119, 0.38), transparent 18%),
    radial-gradient(circle at 88% 6%, rgba(15, 107, 120, 0.16), transparent 18%),
    linear-gradient(180deg, #fcfaf6 0%, #f4ece2 55%, #e8e2d8 100%);
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.9), transparent 15%),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.55), transparent 18%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 340px;
  gap: 22px;
  padding: 30px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 249, 241, 0.95), rgba(255, 236, 219, 0.88)),
    linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent);
}

.eyebrow,
.step,
.bank-label,
.hero-label,
.visual-kicker {
  margin: 0 0 12px;
  font-size: 0.79rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}

.eyebrow,
.step,
.bank-label,
.hero-label {
  color: var(--warm);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
.visual-title {
  font-family: "Baskerville", "Times New Roman", serif;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
}

.intro,
.panel-copy,
.drop-text,
.hero-feedback,
.feedback-line,
.visual-response,
.drop-response,
.dual-summary,
.dual-node p {
  color: var(--muted);
  line-height: 1.65;
}

.dual-coding-card {
  margin: 10px 0 18px;
  padding: 0;
}

.dual-coding-head {
  margin-bottom: 12px;
}

.dual-kicker {
  margin: 0 0 4px;
  color: var(--cool);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dual-summary {
  margin-bottom: 0;
}

.dual-diagram {
  position: relative;
  width: 80%;
  margin: 0 auto;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 203, 119, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(249, 240, 229, 0.92));
  border: 1px solid rgba(29, 41, 57, 0.08);
  overflow: hidden;
}

.diagram-svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-lines line {
  stroke-width: 3;
  stroke-linecap: round;
}

.diagram-lines-green line {
  stroke: rgba(122, 181, 65, 0.9);
}

.diagram-lines-blue line {
  stroke: rgba(78, 121, 196, 0.9);
}

.diagram-lines-orange line {
  stroke: rgba(237, 128, 42, 0.92);
}

.diagram-node rect {
  stroke: rgba(255, 255, 255, 0.56);
  stroke-width: 1.5;
  filter: drop-shadow(0 16px 24px rgba(23, 35, 49, 0.12));
}

.diagram-node text {
  fill: #fff;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  font-size: 21px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  alignment-baseline: middle;
}

.diagram-node tspan {
  text-anchor: middle;
  dominant-baseline: middle;
  alignment-baseline: middle;
}

.diagram-node-root rect {
  fill: url(#diagramRootFill);
}

.diagram-node-green rect {
  fill: url(#diagramGreenFill);
}

.diagram-node-blue rect {
  fill: url(#diagramBlueFill);
}

.diagram-node-orange rect {
  fill: url(#diagramOrangeFill);
}

.hero-panel {
  padding: 20px;
  border-radius: 24px;
  background: rgba(20, 45, 58, 0.92);
  color: #f5f7fa;
  align-self: start;
  margin-top: 78px;
}

.hero-panel .hero-label,
.hero-panel .hero-feedback {
  color: #dbe7f0;
}

.hero-stats {
  display: grid;
  gap: 14px;
}

.hero-stats div {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stats div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-stats span {
  display: block;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.78;
}

.hero-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
}

.panel {
  margin-top: 22px;
  padding: 26px;
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.panel-warm {
  background: linear-gradient(135deg, rgba(255, 248, 243, 0.95), rgba(255, 232, 221, 0.88));
}

.panel-cool {
  background: linear-gradient(135deg, rgba(247, 253, 254, 0.95), rgba(224, 245, 247, 0.9));
}

.panel-retrieval {
  background: linear-gradient(135deg, rgba(250, 252, 245, 0.96), rgba(236, 245, 224, 0.9));
}

.panel-dark {
  color: #f3f7f8;
  background:
    radial-gradient(circle at top right, rgba(255, 203, 119, 0.18), transparent 24%),
    linear-gradient(135deg, #122532, #173746 55%, #204f59);
}

.panel-dark .step,
.panel-dark .bank-label {
  color: var(--gold);
}

.panel-dark .panel-copy,
.panel-dark .feedback-line {
  color: rgba(243, 247, 248, 0.82);
}

.panel-heading,
.button-row,
.matching-layout,
.hero-stats,
.revision-grid,
.visual-grid,
.exam-grid,
.option-list,
.term-bank-grid,
.drop-zone-grid {
  display: grid;
}

.panel-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.button-row {
  grid-auto-flow: column;
  gap: 10px;
}

.button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.button:hover,
.button:focus-visible,
.term-chip:hover,
.term-chip:focus-visible,
.drop-slot:hover,
.drop-slot:focus-visible,
.option-button:hover,
.option-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 35, 49, 0.11);
}

.button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--warm), #a3331c);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.48);
}

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

.download-panel {
  position: relative;
  z-index: 1;
  margin: 12px 0 6px;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px 0 6px;
}

.download-btn {
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  min-width: 260px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #b63d2b, #8d1d29);
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(141, 29, 41, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.download-btn:hover,
.download-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px rgba(141, 29, 41, 0.3);
  outline: none;
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.download-status {
  margin: 0;
  min-height: 1.5rem;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.matching-layout {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.term-bank,
.drop-card,
.visual-card,
.revision-card {
  border: 1px solid var(--line);
  border-radius: 24px;
}

.term-bank {
  position: sticky;
  top: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.term-bank-grid {
  gap: 10px;
}

.term-chip,
.drop-slot,
.option-button {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.term-chip {
  padding: 14px 15px;
  text-align: left;
  cursor: grab;
  font-weight: 700;
}

.term-chip.is-selected {
  border-color: rgba(197, 85, 47, 0.55);
  background: var(--warm-soft);
}

.term-chip.is-used {
  opacity: 0.42;
}

.drop-zone-grid {
  gap: 16px;
}

.drop-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.68);
}

.drop-number {
  margin-bottom: 8px;
  color: var(--cool);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

.drop-slot {
  min-height: 72px;
  margin-top: 14px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.drop-slot.is-target {
  border-color: rgba(15, 107, 120, 0.58);
  background: var(--cool-soft);
}

.drop-slot.has-answer {
  background: rgba(255, 255, 255, 0.96);
}

.slot-label {
  display: block;
  font-weight: 700;
}

.drop-response,
.feedback-line,
.visual-response {
  min-height: 26px;
  margin-bottom: 0;
}

.is-correct {
  color: var(--good);
}

.is-incorrect {
  color: var(--bad);
}

.visual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.visual-card {
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.visual-image-wrap {
  background:
    linear-gradient(180deg, rgba(23, 48, 61, 0.08), rgba(23, 48, 61, 0)),
    #f7fbfc;
  padding: 14px;
}

.visual-image {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.visual-body {
  padding: 18px;
}

.visual-kicker {
  color: var(--cool);
}

.visual-title {
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.option-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.option-button {
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.option-button.is-selected {
  border-color: rgba(15, 107, 120, 0.55);
  background: var(--cool-soft);
}

.option-button.is-correct {
  background: rgba(23, 114, 69, 0.14);
  border-color: rgba(23, 114, 69, 0.48);
}

.option-button.is-incorrect {
  background: rgba(170, 45, 49, 0.12);
  border-color: rgba(170, 45, 49, 0.42);
}

.exam-card,
.exam-response-card,
.model-answer-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.exam-scenario,
.exam-prompt {
  margin-bottom: 14px;
  line-height: 1.7;
}

.exam-scenario-list {
  margin: 0 0 16px;
  padding-left: 22px;
  line-height: 1.7;
}

.exam-scenario-list li + li {
  margin-top: 10px;
}

.exam-response-card {
  padding: 16px;
}

.exam-response-title {
  margin-bottom: 12px;
  font-weight: 800;
}

.exam-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.exam-field label {
  font-weight: 700;
}

.exam-select,
.exam-purpose {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
}

.exam-purpose {
  resize: vertical;
  min-height: 128px;
}

.exam-select.is-correct,
.exam-purpose.is-correct {
  border-color: rgba(23, 114, 69, 0.55);
  background: rgba(23, 114, 69, 0.1);
}

.exam-select.is-incorrect,
.exam-purpose.is-incorrect {
  border-color: rgba(170, 45, 49, 0.46);
  background: rgba(170, 45, 49, 0.08);
}

.exam-select:disabled,
.exam-purpose:disabled {
  cursor: not-allowed;
}

.exam-feedback {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.model-answer-card {
  margin-top: 16px;
  background: rgba(255, 250, 240, 0.92);
  border-color: rgba(195, 130, 38, 0.28);
}

.model-answer-label {
  margin-bottom: 8px;
  color: #9d5f15;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.model-answer-text {
  margin-bottom: 0;
  line-height: 1.65;
}

.revision-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.revision-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.revision-card h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  color: #fff;
}

.revision-card p {
  margin-bottom: 0;
  color: rgba(243, 247, 248, 0.82);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .hero,
  .matching-layout,
  .panel-heading,
  .visual-grid,
  .exam-grid,
  .revision-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-auto-flow: row;
  }

  .term-bank {
    position: static;
  }

  .hero-panel {
    margin-top: 0;
  }

  .dual-coding-card {
    padding: 0;
  }

  .dual-diagram {
    width: 100%;
    padding: 8px;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 20px, 1240px);
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 24px;
  }

  .option-list {
    grid-template-columns: 1fr;
  }
}
