:root {
  --ink: #1d2530;
  --muted: #667085;
  --paper: #fffaf5;
  --surface: #ffffff;
  --line: #e5e7eb;
  --green: #16845f;
  --blue: #1f65b7;
  --rose: #c5446b;
  --amber: #d9822b;
  --violet: #6446c6;
  --shadow: 0 18px 45px rgba(37, 43, 58, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 250, 245, .95), rgba(244, 248, 250, .98)),
    radial-gradient(circle at 10% 10%, rgba(22, 132, 95, .18), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(217, 130, 43, .2), transparent 25%);
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(229, 231, 235, .86);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
}

.topbar {
  width: min(1160px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 8px 22px rgba(31, 101, 183, .25);
}

.nav-tabs,
.result-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
}

.nav-tab,
.result-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.nav-tab.is-active,
.result-tab.is-active {
  color: #fff;
  background: var(--ink);
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 620px);
  align-items: center;
  gap: 48px;
  padding: 26px 0 18px;
}

.hero-copy {
  max-width: 650px;
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.4rem, 6vw, 5.8rem);
  line-height: .98;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-lead {
  max-width: 560px;
  color: #394150;
  font-size: 1.2rem;
  line-height: 1.8;
}

.hero-page-title {
  width: min(100%, 430px);
  margin-top: 28px;
  display: grid;
  justify-items: center;
  text-align: center;
  scroll-margin-top: 88px;
}

.hero-page-title .eyebrow {
  margin-bottom: 8px;
}

.hero-page-title h2 {
  margin: 0;
  font-size: clamp(2.9rem, 5.2vw, 4.8rem);
  line-height: 1;
}

.hero-board {
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 6px;
  width: min(92%, 620px);
  padding: 18px 30px;
}

.hero-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  perspective: 900px;
}

.hero-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.68);
  transition: transform .45s ease, opacity .45s ease, filter .45s ease;
}

.hero-slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.hero-slide.is-active {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.hero-slide.is-prev {
  z-index: 2;
  opacity: .72;
  transform: translate(-112%, -50%) rotateY(18deg) scale(.68);
  filter: saturate(.92);
}

.hero-slide.is-next {
  z-index: 2;
  opacity: .72;
  transform: translate(12%, -50%) rotateY(-18deg) scale(.68);
  filter: saturate(.92);
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.slider-dot {
  width: 34px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d6dbe3;
  cursor: pointer;
}

.slider-dot.is-active {
  background: var(--ink);
}

.page-panel {
  padding: 54px 0 34px;
}

.page-panel[hidden],
.result-panel[hidden] {
  display: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.structure-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, .85fr);
  gap: 24px;
  align-items: start;
}

.structure-content {
  display: grid;
  gap: 0;
}

.structure-content .stage-grid {
  gap: 10px;
}

.structure-content .stage-card {
  padding: 14px 18px;
}

.structure-content .stage-card h3 {
  margin: 8px 0 6px;
  font-size: 1.26rem;
}

.structure-content .stage-card p {
  line-height: 1.55;
}

.feature-image,
.honor-card,
.work-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.feature-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  margin-top: var(--structure-heading-offset, 0);
}

.feature-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.stage-grid,
.work-grid {
  display: grid;
  gap: 14px;
}

.stage-card,
.work-card {
  padding: 22px;
  border-left: 8px solid var(--green);
}

.stage-card.mid {
  border-left-color: var(--rose);
}

.stage-card.high {
  border-left-color: var(--blue);
}

.stage-label,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  font-size: .86rem;
  font-weight: 900;
  background: var(--green);
}

.stage-card h3,
.honor-card h3,
.result-copy h3 {
  margin: 12px 0 10px;
  font-size: 1.45rem;
}

.stage-card p,
.honor-card p,
.result-copy p,
.work-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.honor-sections {
  display: grid;
  gap: 22px;
}

.honor-feature {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(280px, .92fr);
  gap: 28px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.honor-feature-scratch {
  grid-template-columns: minmax(280px, .86fr) minmax(380px, 1.14fr);
}

.honor-copy {
  max-width: 520px;
}

.honor-copy h3 {
  margin: 14px 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.25;
}

.honor-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.honor-carousel {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #eef4f8;
}

.honor-carousel-stage {
  position: absolute;
  inset: 0;
}

.honor-carousel-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .65s ease, transform .65s ease;
}

.honor-carousel-stage img.is-active {
  opacity: 1;
  transform: scale(1);
}

.honor-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 37, 48, .74);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  transform: translateY(-50%);
}

.honor-arrow-prev {
  left: 12px;
}

.honor-arrow-next {
  right: 12px;
}

.honor-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.honor-carousel-dot {
  width: 24px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
}

.honor-carousel-dot.is-active {
  background: var(--ink);
}

.pill.violet {
  background: var(--violet);
}

.pill.rose {
  background: var(--rose);
}

.pill.green {
  background: var(--green);
}

.pill.blue {
  background: var(--blue);
}

.pill.amber {
  background: var(--amber);
}

.result-tabs {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 22px;
  overflow-x: auto;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.result-copy {
  position: sticky;
  top: 98px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.gallery {
  display: grid;
  gap: 16px;
}

.scratch-showcase {
  display: grid;
  gap: 16px;
}

.scratch-player {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.scratch-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.scratch-project-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.scratch-project-group {
  display: contents;
}

.scratch-student-list {
  display: flex;
  flex-wrap: wrap;
  order: 1;
  flex-basis: 100%;
  gap: 8px;
}

.scratch-project-list[hidden],
.scratch-student-list[hidden] {
  display: none;
}

.scratch-project-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.scratch-project-button.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.scratch-student-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: .9rem;
}

.inkscape-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.inkscape-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.inkscape-carousel-stage {
  position: relative;
  height: 310px;
  background: #f8fafc;
}

.inkscape-carousel-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .6s ease, transform .6s ease;
}

.inkscape-carousel-stage img.is-active {
  opacity: 1;
  transform: scale(1);
}

.inkscape-arrow {
  position: absolute;
  top: 145px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 37, 48, .72);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  transform: translateY(-50%);
}

.inkscape-arrow-prev {
  left: 10px;
}

.inkscape-arrow-next {
  right: 10px;
}

.inkscape-dots {
  position: absolute;
  left: 50%;
  top: 282px;
  z-index: 2;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.inkscape-dot {
  width: 22px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 37, 48, .2);
  cursor: pointer;
}

.inkscape-dot.is-active {
  background: var(--ink);
}

.unplugged-showcase,
.microbit-showcase {
  display: grid;
  gap: 16px;
}

.media-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.media-switch-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 43, 58, .06);
}

.media-switch-button.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.media-switch-button:focus-visible {
  outline: 3px solid rgba(18, 135, 102, .25);
  outline-offset: 2px;
}

[data-media-panel][hidden] {
  display: none;
}

.unplugged-photo-card,
.camp-photo-card,
.microbit-photo-card,
.microbit-code-card,
.video-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.unplugged-photo-card,
.camp-photo-card,
.microbit-photo-card {
  position: relative;
}

.unplugged-carousel-stage,
.camp-carousel-stage,
.microbit-carousel-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f8fafc;
}

.unplugged-carousel-stage img,
.camp-carousel-stage img,
.microbit-carousel-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .6s ease, transform .6s ease;
}

.unplugged-carousel-stage img.is-active,
.camp-carousel-stage img.is-active,
.microbit-carousel-stage img.is-active {
  opacity: 1;
  transform: scale(1);
}

.unplugged-arrow,
.camp-arrow,
.microbit-arrow {
  position: absolute;
  top: calc(50% - 18px);
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 37, 48, .72);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.unplugged-arrow-prev,
.camp-arrow-prev,
.microbit-arrow-prev {
  left: 12px;
}

.unplugged-arrow-next,
.camp-arrow-next,
.microbit-arrow-next {
  right: 12px;
}

.unplugged-dots,
.camp-dots,
.microbit-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px 0;
}

.unplugged-dot,
.camp-dot,
.microbit-dot {
  width: 22px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 37, 48, .22);
  cursor: pointer;
}

.unplugged-dot.is-active,
.camp-dot.is-active,
.microbit-dot.is-active {
  background: var(--ink);
}

.unplugged-photo-card figcaption,
.microbit-photo-card figcaption,
.microbit-code-card figcaption {
  padding: 12px 14px 6px;
  color: var(--ink);
  font-weight: 900;
}

.photo-note {
  margin: 0;
  padding: 0 14px 16px;
  color: var(--muted);
  line-height: 1.7;
  font-size: .98rem;
}

.camp-photo-note {
  margin: 0;
  padding: 14px 18px 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
}

.camp-layout {
  display: grid;
  gap: 18px;
}

.camp-day-panel {
  display: grid;
  gap: 16px;
}

.camp-day-panel[hidden] {
  display: none;
}

.camp-note,
.camp-empty {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
}

.camp-note h4,
.camp-empty h4 {
  margin: 0 0 10px;
  font-size: 1.24rem;
}

.camp-note p,
.camp-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.primary-link-button {
  min-height: 44px;
  margin-top: 18px;
  padding: 0 20px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(22, 132, 95, .18);
}

.camp-arrow-prev::before {
  content: "<";
}

.camp-arrow-next::before {
  content: ">";
}

.microbit-code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.microbit-code-card img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #080808;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-card figcaption {
  padding: 12px 14px 14px;
  color: var(--ink);
  font-weight: 900;
}

.inkscape-card figcaption {
  padding: 12px 14px 14px;
  color: var(--ink);
  font-weight: 900;
}

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

.gallery img {
  width: 100%;
  height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 43, 58, .08);
  object-fit: contain;
}

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

.work-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left-color: var(--amber);
}

.work-card strong {
  margin-bottom: 12px;
  font-size: 1.32rem;
}

.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 46px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar {
    min-height: 96px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .nav-tabs {
    overflow-x: auto;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  .hero-board {
    max-width: 680px;
    width: min(100%, 420px);
  }

  .structure-layout,
  .result-panel,
  .main-honor {
    grid-template-columns: 1fr;
  }

  .honor-feature,
  .honor-feature-scratch {
    grid-template-columns: 1fr;
  }

  .result-copy {
    position: static;
  }

  .gallery.three,
  .work-grid,
  .inkscape-gallery,
  .microbit-code-grid {
    grid-template-columns: 1fr;
  }

  .gallery img {
    height: auto;
    max-height: 760px;
  }
}

@media (max-width: 560px) {
  main,
  .topbar,
  .site-footer {
    width: min(100% - 22px, 1160px);
  }

  .brand {
    white-space: normal;
  }

  .nav-tab,
  .result-tab {
    padding: 0 12px;
    white-space: nowrap;
  }

  h1 {
    font-size: clamp(2.4rem, 12vw, 3rem);
    white-space: normal;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .hero-board {
    padding: 12px;
  }

  .hero-slide {
    width: 78%;
  }

  .hero-slide.is-prev {
    transform: translate(-106%, -50%) rotateY(14deg) scale(.68);
  }

  .hero-slide.is-next {
    transform: translate(6%, -50%) rotateY(-14deg) scale(.68);
  }

  .honor-feature {
    padding: 14px;
  }

  .page-panel {
    padding-top: 42px;
  }
}
