:root {
  color-scheme: light;
  --ink: #25203a;
  --muted: #625a73;
  --paper: #f8f6ff;
  --surface: #fff;
  --violet: #532cc4;
  --violet-deep: #401eaa;
  --lavender: #e6dcff;
  --yellow: #ffdf60;
  --peach: #ffead4;
  --line: #ded7ed;
  --green: #196240;
  --green-surface: #e9f7ee;
  --red: #953a35;
  --red-surface: #fff0ea;
  --radius: 16px;
  font-family: "Microsoft JhengHei", "PingFang HK", "Noto Sans CJK HK", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
h1[tabindex], h2[tabindex] { outline: none; }

.shell {
  width: min(100% - 64px, 1136px);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .05em;
}

.brand-mark {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  color: var(--surface);
  background: var(--violet);
  border: 1px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  letter-spacing: 0;
}

.brand-copy { display: grid; gap: 4px; }

.company-name {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}

.header-link {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 700;
}

.header-link:hover {
  color: var(--violet-deep);
  border-color: var(--violet);
}

.header-link-home {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

.header-link-home .header-link-label { display: none; }

.home-icon {
  display: none;
  position: relative;
  width: 18px;
  height: 18px;
}

.header-link-home .home-icon { display: block; }

.home-icon::before, .home-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.home-icon::before {
  inset: 2px 3px auto;
  height: 12px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 2px;
  transform: rotate(45deg);
}

.home-icon::after {
  inset: 7px 3px 1px;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.hero {
  display: grid;
  grid-template-columns: 47% 53%;
  min-height: 392px;
  margin-top: 36px;
  overflow: hidden;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 21px;
  padding: 34px clamp(26px, 4.15vw, 57px);
}

.hero-kicker {
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 4px 11px;
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.hero h1 {
  font-size: clamp(3.2rem, 6vw, 5.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.09em;
}

.hero-punctuation { color: var(--violet-deep); }

.hero-description {
  font-size: clamp(1.025rem, 1.6vw, 1.275rem);
  font-weight: 650;
  line-height: 1.65;
}

.hero-art {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #33284d;
  border-inline-start: 2px solid var(--ink);
}

.hero-art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 52%;
}

.topics {
  margin-block: 46px 64px;
  scroll-margin-top: 22px;
}

.topics-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
  margin-bottom: 17px;
}

.topics-heading h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.3rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.045em;
}

.topics-heading p {
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 700;
}

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

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 19px;
  min-height: 168px;
  padding: 20px 23px 23px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}

.topic-card-slang { background: var(--lavender); }
.topic-card-culture { background: var(--peach); }

@media (hover: hover) {
  .topic-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--ink);
  }
}

.topic-top, .topic-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.topic-top { align-items: center; }
.topic-bottom { align-items: flex-end; }

.topic-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 10px;
}

.icon-slang { background: var(--violet); color: white; }
.icon-culture { background: #ffc475; color: var(--ink); }

.icon-slang span {
  position: relative;
  width: 22px;
  height: 16px;
  margin-top: -3px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.icon-slang span::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 3px;
  bottom: -4px;
  transform: skewY(-38deg);
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: var(--violet);
}

.icon-slang span::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  top: 5px;
  left: 4px;
  background: currentColor;
  box-shadow: 4px 0 currentColor, 8px 0 currentColor;
}

.icon-culture span {
  position: relative;
  width: 23px;
  height: 18px;
  margin-top: -2px;
  border: 2px solid currentColor;
  border-radius: 47%;
}

.icon-culture span::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 15px;
  left: 5px;
  top: -1px;
  border-inline: 1px solid currentColor;
  border-radius: 50%;
}

.icon-culture span::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 4px;
  left: 9px;
  top: 16px;
  background: currentColor;
  box-shadow: 0 -22px currentColor;
}

.topic-count {
  padding: 3px 10px;
  border: 1px solid rgb(37 32 58 / 35%);
  border-radius: 999px;
  font-weight: 750;
  font-size: .875rem;
}

.topic-card h3 {
  margin-bottom: 4px;
  font-size: clamp(1.48rem, 2.7vw, 1.95rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.045em;
}

.topic-card p { color: #4e445d; }

.topic-action {
  flex: none;
  padding: 7px 12px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 7px;
  color: white;
  font-size: .875rem;
  font-weight: 750;
  white-space: nowrap;
}

.script-note { margin-top: 1rem; }

.play-view {
  --topic-color: var(--lavender);
  width: min(100%, 733px);
  margin: 40px auto 64px;
}

.play-view[data-theme="culture"] { --topic-color: var(--peach); }

.quiz-progress { margin-bottom: 18px; }

.quiz-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quiz-topic {
  width: fit-content;
  padding: 4px 11px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--topic-color);
  font-size: .9375rem;
  font-weight: 800;
}

.question-count {
  color: var(--muted);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

#question-progress {
  display: block;
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  accent-color: var(--violet);
}

#question-progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
#question-progress::-webkit-progress-value { background: var(--violet); border-radius: 999px; }
#question-progress::-moz-progress-bar { background: var(--violet); border-radius: 999px; }

.question-card, .result-card {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}

.question-card { padding: clamp(20px, 4.5vw, 40px); }

.question-instruction {
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 750;
  margin-bottom: 8px;
}

#question-text {
  margin-bottom: 18px;
  line-height: 1.35;
  font-size: clamp(1.55rem, 4.1vw, 2.4rem);
  font-weight: 850;
  letter-spacing: -.035em;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.question-blank {
  display: inline-block;
  width: 2.2em;
  height: .85em;
  margin-inline: .12em;
  vertical-align: -.06em;
  border-bottom: .085em solid var(--violet);
}

.hint {
  margin-bottom: 23px;
}

.hint-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff6ce;
  border: 1px solid #e9d67b;
  border-radius: 8px;
  color: #5b4200;
  font-weight: 850;
  cursor: pointer;
}

.hint-button:hover { background: #ffefae; }

.hint-icon {
  position: relative;
  flex: none;
  width: 16px;
  height: 18px;
}

.hint-icon::before, .hint-icon::after {
  content: "";
  position: absolute;
}

.hint-icon::before {
  top: 1px;
  left: 2px;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 35% 35%;
}

.hint-icon::after {
  bottom: 1px;
  left: 5px;
  width: 6px;
  border-bottom: 2px solid currentColor;
}

#question-hint {
  margin-top: 9px;
  padding: 11px 13px;
  background: #fff6ce;
  border: 1px solid #e9d67b;
  border-radius: 9px;
}

#choices {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 57px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.choice:has(input:enabled):hover { border-color: var(--violet); }
.choice:has(input:disabled) { cursor: default; }

.choice:has(input:checked:enabled) {
  background: #f0eaff;
  border-color: var(--violet);
}

.choice-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f2eef9;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 850;
}

.choice-answer { font-size: 1.0625rem; font-weight: 750; overflow-wrap: anywhere; }

.choice-status {
  font-size: .875rem;
  font-weight: 850;
  white-space: nowrap;
}

.choice-dot {
  width: 18px;
  height: 18px;
  border: 1px solid #897c9d;
  border-radius: 50%;
  background: white;
}

.choice:has(input:checked) .choice-dot {
  border-width: 5px;
}

.choice:has(input:checked:enabled) .choice-dot { border-color: var(--violet); }

.choice[data-state="correct"] {
  background: var(--green-surface);
  border-color: var(--green);
  color: var(--green);
}

.choice[data-state="wrong"] {
  background: var(--red-surface);
  border-color: var(--red);
  color: var(--red);
}

.choice[data-state="correct"] .choice-dot { border-color: var(--green); }
.choice[data-state="wrong"] .choice-dot { border-color: var(--red); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 10px 19px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: white;
  background: var(--violet);
  box-shadow: 2px 2px 0 var(--ink);
}

.button-primary:hover:enabled { background: var(--violet-deep); }
.button-secondary { background: var(--surface); }
.button-secondary:hover { background: var(--lavender); }

.button:disabled {
  background: #eeeaf4;
  border-color: #d7cfe3;
  color: #655d72;
  box-shadow: none;
  cursor: default;
}

#submit-answer { margin-top: 18px; }

.feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding: 15px;
  border: 1px solid;
  border-radius: 9px;
}

.feedback[data-state="correct"] { background: var(--green-surface); border-color: #a2cfb1; }
.feedback[data-state="wrong"] { background: var(--red-surface); border-color: #e2aea2; }
.feedback-content { flex: 1 1 300px; }
.feedback h2 { margin-bottom: 3px; font-size: 1.175rem; }
.feedback[data-state="correct"] h2 { color: var(--green); }
.feedback[data-state="wrong"] h2 { color: var(--red); }
.feedback p { overflow-wrap: anywhere; }

.result-card {
  display: grid;
  justify-items: center;
  padding: clamp(24px, 7vw, 64px) 20px;
  text-align: center;
}

.result-card h1 {
  margin-top: 13px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.15;
  font-weight: 900;
}

.result-label { color: var(--muted); font-weight: 750; }

.result-score {
  margin-bottom: 22px;
  color: var(--violet-deep);
  font-size: clamp(3.2rem, 9vw, 6rem);
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.065em;
}

.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 880px) {
  .topic-bottom { flex-wrap: wrap; align-items: flex-start; }
}

@media (max-width: 670px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 63px; }
  .hero { grid-template-columns: 1fr; min-height: auto; margin-top: 23px; }
  .hero-copy { gap: 15px; padding: 24px; }
  .hero h1 { font-size: clamp(2.15rem, 8.1vw, 3.7rem); }
  .hero h1 br { display: none; }
  .hero-art { min-height: 0; aspect-ratio: 2.15; border-inline-start: 0; border-top: 2px solid var(--ink); }
  .hero-art img { object-position: 50% 59%; }
  .hero-description br { display: none; }
  .topics { margin-block: 31px 44px; }
  .topic-grid { grid-template-columns: 1fr; gap: 15px; }
  .topic-card { min-height: 140px; gap: 13px; padding: 15px 17px 17px; }
  .topic-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3px 9px;
  }
  .topic-bottom > div { display: contents; }
  .topic-bottom h3 { grid-area: 1 / 1; margin-bottom: 0; }
  .topic-bottom p { grid-area: 2 / 1 / auto / -1; }
  .topic-action { grid-area: 1 / 2; }
  .play-view { margin: 25px auto 44px; }
}

@media (max-width: 390px) {
  .choice { gap: 7px; padding-inline: 8px; }
  .choice-answer { font-size: 1rem; }
  #submit-answer, #next-question { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
