:root {
  --ink: #101010;
  --paper: #fff8e5;
  --paper-2: #f5ebcf;
  --red: #f04b37;
  --blue: #2457d6;
  --yellow: #f8d347;
  --green: #1d9f78;
  --white: #ffffff;
  --shadow: 7px 7px 0 var(--ink);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 16, 16, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  font-family:
    "Noto Sans TC", "Noto Sans JP", "Microsoft JhengHei", "Yu Gothic", "Meiryo",
    "PingFang TC", system-ui, sans-serif;
  line-height: 1.72;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--yellow);
  border: 3px solid var(--ink);
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 14px 28px 10px;
  border-bottom: 4px solid var(--ink);
  background: rgba(255, 248, 229, 0.94);
  backdrop-filter: blur(14px);
}

.language-switcher {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.language-button {
  min-width: 42px;
  min-height: 34px;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
  transition:
    translate 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.language-button:hover,
.language-button:focus-visible {
  translate: 2px 2px;
  box-shadow: 1px 1px 0 var(--ink);
}

.language-button.active {
  background: var(--red);
  color: var(--white);
}

.header-mark {
  display: grid;
  grid-template-columns: repeat(3, 18px);
  gap: 5px;
  width: max-content;
}

.header-mark span {
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
}

.header-mark span:nth-child(1) {
  background: var(--red);
}

.header-mark span:nth-child(2) {
  border-radius: 50%;
  background: var(--blue);
}

.header-mark span:nth-child(3) {
  background: var(--yellow);
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-nav a {
  padding: 6px 12px;
  border: 3px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 800;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-color: var(--ink);
  background: var(--white);
}

.progress-shell {
  width: 130px;
  height: 14px;
  border: 3px solid var(--ink);
  background: var(--white);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--blue);
}

.hero-section {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(310px, 0.86fr) minmax(420px, 1.14fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 70px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 52px 34px 42px;
}

.moving-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border: 4px solid var(--ink);
  animation: drift 11s linear infinite alternate;
}

.shape-red {
  width: 74px;
  height: 74px;
  left: 4%;
  top: 4%;
  background: var(--red);
  transform: rotate(12deg);
}

.shape-blue {
  width: 118px;
  height: 118px;
  right: 6%;
  top: 9%;
  border-radius: 50%;
  background: var(--blue);
  animation-delay: -3s;
}

.shape-yellow {
  width: 150px;
  height: 72px;
  left: 46%;
  bottom: 6%;
  background: var(--yellow);
  animation-delay: -5s;
}

@keyframes drift {
  from {
    translate: 0 0;
  }

  to {
    translate: 24px 18px;
  }
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.section-number {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 24px;
  font-size: 3.6rem;
  line-height: 1.04;
  font-weight: 950;
  max-width: 10.5em;
}

h2 {
  margin-bottom: 16px;
  font-size: 2.3rem;
  line-height: 1.18;
  font-weight: 950;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.28rem;
  line-height: 1.32;
  font-weight: 900;
}

.lead {
  max-width: 43em;
  font-size: 1.12rem;
  font-weight: 650;
  background: var(--paper);
  border-left: 8px solid var(--red);
  padding: 14px 18px;
}

.hero-actions,
.form-actions,
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.solid-button,
.line-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 4px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 950;
  line-height: 1.25;
  box-shadow: 5px 5px 0 var(--ink);
  transition: translate 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.solid-button {
  background: var(--yellow);
}

.line-button {
  background: var(--white);
}

.solid-button:hover,
.line-button:hover,
.solid-button:focus-visible,
.line-button:focus-visible {
  translate: 3px 3px;
  box-shadow: 2px 2px 0 var(--ink);
}

.hero-image-frame {
  position: relative;
  z-index: 1;
  margin: 0;
}

.hero-image-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 5px solid var(--ink);
  box-shadow: var(--shadow);
}

.hero-image-frame figcaption {
  margin-top: 14px;
  max-width: 46em;
  font-size: 0.94rem;
  font-weight: 760;
}

.source-strip,
.concept-section,
.mechanism-section,
.examples-section,
.conditions-section,
.practice-section,
.sources-section {
  border-top: 5px solid var(--ink);
}

.source-strip {
  display: grid;
  grid-template-columns: 240px 300px 1fr;
  gap: 26px;
  align-items: center;
  padding: 28px 34px;
  background: var(--white);
}

.strip-title span,
.square-chip,
.panel-kicker {
  display: inline-block;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  background: var(--blue);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.1;
}

.strip-title strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 950;
}

.tweet-frame {
  margin: 0;
}

.tweet-frame img {
  width: 100%;
  border: 4px solid var(--ink);
  background: var(--white);
}

.source-strip p {
  margin: 0;
  font-weight: 680;
}

.concept-section,
.mechanism-section,
.examples-section,
.conditions-section,
.practice-section,
.sources-section {
  padding: 58px 34px;
}

.section-heading {
  max-width: var(--max);
  margin: 0 auto 30px;
}

.section-intro {
  max-width: 60em;
  font-weight: 680;
}

.concept-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(330px, 1.06fr);
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.essay-panel,
.anchor-lab,
.tab-panel,
.flow-panel,
.scenario-grid article,
.condition-copy,
.practice-form,
.output-panel {
  border: 5px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.essay-panel {
  padding: 28px;
  font-size: 1.08rem;
  font-weight: 620;
}

.essay-panel p:last-child,
.tab-panel p:last-child,
.condition-copy p:last-child {
  margin-bottom: 0;
}

.anchor-lab {
  padding: 18px;
  background: var(--paper-2);
}

.panel-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-title-row h3 {
  margin: 0;
}

.anchor-svg {
  overflow: visible;
  border: 4px solid var(--ink);
  background: var(--white);
}

.svg-title {
  font-size: 21px;
  font-weight: 950;
  fill: var(--ink);
}

.svg-big {
  font-size: 27px;
  font-weight: 950;
  fill: var(--ink);
}

.svg-small,
.svg-label {
  font-size: 16px;
  font-weight: 800;
  fill: var(--ink);
}

.svg-axis,
.svg-bar-label {
  font-size: 15px;
  font-weight: 900;
  fill: var(--ink);
}

.anchor-card rect {
  stroke: var(--ink);
  stroke-width: 5;
}

.price-card rect {
  fill: var(--red);
}

.future-card rect {
  fill: var(--yellow);
}

.price-card text {
  fill: var(--white);
}

.bar-shell {
  fill: var(--white);
  stroke: var(--ink);
  stroke-width: 4;
}

.price-bar {
  fill: var(--red);
}

.future-bar {
  fill: var(--blue);
}

.focus-marker circle {
  fill: var(--ink);
}

.focus-marker text {
  font-size: 15px;
  font-weight: 950;
  fill: var(--ink);
}

.anchor-card,
.focus-marker,
.price-bar,
.future-bar {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    width 180ms ease;
}

.range-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
  font-size: 0.88rem;
  font-weight: 900;
}

.range {
  width: 100%;
  accent-color: var(--red);
}

.micro-copy {
  margin: 12px 0 0;
  font-size: 0.92rem;
  font-weight: 760;
}

.mechanism-section {
  background: var(--paper-2);
}

.mechanism-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--max);
  margin: 0 auto 20px;
}

.tab-button,
.condition-item {
  border: 4px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-weight: 950;
  box-shadow: 4px 4px 0 var(--ink);
}

.tab-button {
  min-width: 88px;
  padding: 10px 16px;
}

.tab-button.active {
  background: var(--red);
  color: var(--white);
}

.tab-stage {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 420px;
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.tab-panel {
  min-height: 420px;
  padding: 30px;
  background: var(--white);
}

.panel-kicker {
  margin-bottom: 18px;
  background: var(--yellow);
  color: var(--ink);
}

.tab-panel h3 {
  font-size: 2rem;
  max-width: 15em;
}

.tab-panel p {
  font-size: 1.06rem;
  font-weight: 620;
}

.flow-panel {
  padding: 18px;
  background: var(--green);
}

.flow-svg {
  width: 100%;
  height: auto;
  background: var(--white);
  border: 4px solid var(--ink);
}

.flow-svg rect,
.flow-svg circle,
.flow-svg polygon {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 5;
}

.flow-svg .step-two circle {
  fill: var(--blue);
}

.flow-svg .step-two text {
  fill: var(--white);
}

.flow-svg .step-three rect {
  fill: var(--red);
}

.flow-svg .step-three text {
  fill: var(--white);
}

.flow-svg .step-four polygon {
  fill: var(--paper);
}

.flow-svg path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: square;
  stroke-dasharray: 12 10;
  animation: dash 2.6s linear infinite;
}

.flow-svg text {
  font-size: 20px;
  font-weight: 950;
  fill: var(--ink);
}

@keyframes dash {
  to {
    stroke-dashoffset: -44;
  }
}

.example-marquee {
  display: flex;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto 22px;
  overflow: hidden;
}

.example-marquee span {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  font-size: 1.2rem;
  font-weight: 950;
  animation: nudge 3.2s ease-in-out infinite alternate;
}

.example-marquee span:nth-child(2n) {
  background: var(--blue);
  color: var(--white);
  animation-delay: -1s;
}

.example-marquee span:nth-child(3n) {
  background: var(--red);
  color: var(--white);
  animation-delay: -2s;
}

@keyframes nudge {
  from {
    translate: 0 0;
  }

  to {
    translate: -18px 0;
  }
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
}

.scenario-grid article {
  padding: 22px;
  min-height: 250px;
}

.scenario-grid article:nth-child(1) {
  background: var(--yellow);
}

.scenario-grid article:nth-child(2) {
  background: var(--white);
}

.scenario-grid article:nth-child(3) {
  background: var(--blue);
  color: var(--white);
}

.scenario-grid article:nth-child(4) {
  background: var(--red);
  color: var(--white);
}

.scenario-grid p {
  margin: 0;
  font-weight: 700;
}

.conditions-section {
  background: var(--white);
}

.condition-board {
  display: grid;
  grid-template-columns: 310px 1fr;
  grid-auto-rows: minmax(62px, auto);
  gap: 12px 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.condition-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
}

.condition-item > span:first-child {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
}

.condition-item .condition-label {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.condition-item.active {
  background: var(--ink);
  color: var(--white);
}

.condition-copy {
  grid-row: 1 / span 5;
  grid-column: 2;
  padding: 30px;
  background: var(--paper);
}

.condition-copy h3 {
  font-size: 2rem;
}

.condition-copy p {
  font-size: 1.08rem;
  font-weight: 680;
}

.practice-section {
  background: var(--paper-2);
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(330px, 0.92fr);
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.practice-form,
.output-panel {
  padding: 24px;
}

.field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-row label,
.checklist legend {
  font-weight: 950;
}

.field-row input,
.field-row select,
.field-row textarea,
#outputText {
  width: 100%;
  border: 4px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 1rem;
  line-height: 1.55;
  outline: none;
}

.field-row textarea,
#outputText {
  resize: vertical;
}

.field-row input:focus,
.field-row select:focus,
.field-row textarea:focus,
#outputText:focus {
  box-shadow: 0 0 0 4px var(--yellow);
}

.two-column-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0;
  padding: 16px;
  border: 4px solid var(--ink);
  background: var(--paper);
}

.checklist legend {
  padding: 0 8px;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 780;
}

.checklist input {
  width: 20px;
  height: 20px;
  margin-top: 5px;
  accent-color: var(--blue);
}

.output-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--white);
}

.score-block {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 288deg, var(--paper-2) 288deg);
  box-shadow: 4px 4px 0 var(--ink);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  font-size: 1.3rem;
  font-weight: 950;
}

#scoreCopy {
  margin: 0;
  font-weight: 760;
}

#outputText {
  min-height: 360px;
  background: #fffdf4;
  font-family:
    "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}

.sources-section {
  background: var(--white);
}

.source-list {
  display: grid;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.source-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 4px solid var(--ink);
  background: var(--paper);
}

.source-list a {
  font-weight: 900;
}

.source-list span {
  padding: 4px 8px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-size: 0.88rem;
  font-weight: 900;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 34px;
  border-top: 5px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 900;
}

.page-footer a {
  color: var(--white);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .language-switcher {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .progress-shell {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hero-section,
  .concept-layout,
  .tab-stage,
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 34px;
  }

  h1 {
    font-size: 2.65rem;
  }

  h2 {
    font-size: 2rem;
  }

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

  .source-strip p {
    grid-column: 1 / -1;
  }

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

  .condition-board {
    grid-template-columns: 1fr;
  }

  .condition-copy {
    grid-row: auto;
    grid-column: auto;
  }

  .output-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header,
  .hero-section,
  .source-strip,
  .concept-section,
  .mechanism-section,
  .examples-section,
  .conditions-section,
  .practice-section,
  .sources-section,
  .page-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .top-nav {
    justify-content: flex-end;
  }

  .top-nav a {
    padding: 4px 8px;
    font-size: 0.86rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2,
  .tab-panel h3,
  .condition-copy h3 {
    font-size: 1.62rem;
  }

  .source-strip,
  .scenario-grid,
  .two-column-fields,
  .checklist,
  .score-block,
  .source-list li {
    grid-template-columns: 1fr;
  }

  .tab-button {
    min-width: auto;
    flex: 1 1 30%;
  }

  .essay-panel,
  .anchor-lab,
  .tab-panel,
  .flow-panel,
  .scenario-grid article,
  .condition-copy,
  .practice-form,
  .output-panel {
    box-shadow: 4px 4px 0 var(--ink);
  }

  .page-footer {
    flex-direction: column;
  }

  .hero-section .shape {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
