:root {
  --ink: #30476c;
  --muted: #66758a;
  --blue: #477fcf;
  --blue-pale: #eaf3ff;
  --paper: #fffefb;
  --line: #dce7f1;
  --focus: #1f5fb9;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

button, img { max-width: 100%; }
button { font: inherit; }

.hero {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #f4edda 0%, #f4edda 72%, #fff 100%);
}
.hero > img:first-of-type { display: block; width: min(73%, 1400px); height: auto; margin-inline: auto; }

.hero-actions { position: absolute; z-index: 5; top: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2.5vw, 2.25rem); }
.share-button {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #78a9dc;
  border-radius: 14px;
  color: #245b99;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 7px 22px rgb(54 95 139 / 14%);
  font-weight: 800;
  cursor: pointer;
}
.share-button svg { width: 25px; height: 25px; fill: currentColor; }
.share-button:hover { background: #eaf4ff; }
.share-button:focus-visible, .work-zoom:focus-visible, .lightbox-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.share-status { position: absolute; top: calc(100% + .4rem); right: 0; width: max-content; max-width: 15rem; color: #36516f; font-size: .875rem; font-weight: 700; }

.hero-decoration { position: absolute; z-index: 1; width: clamp(48px, 6vw, 90px); height: auto; pointer-events: none; }
.hero-decoration--tools { left: 4vw; bottom: 13%; transform: rotate(-11deg); }
.hero-decoration--palette { right: 4vw; bottom: 12%; transform: rotate(12deg); }

.awards-container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) 0 5rem;
}

.grade-tabs-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0 auto clamp(3rem, 6vw, 5rem);
}

.grade-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(910px, calc(100% - 40px));
  gap: clamp(.55rem, 1.4vw, 1rem);
}

.grade-tab {
  position: relative;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  padding: .7rem .5rem;
  gap: .65rem;
  border: 2px solid transparent;
  border-radius: 22px;
  color: #536884;
  background: #f3f7fb;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}

.grade-tab img { width: 48px; height: 56px; object-fit: contain; object-position: center 18%; }
.grade-tab--senior { background: #d9edff; }
.grade-tab--middle { background: #fff2e8; }
.grade-tab--junior { background: #ebf5e7; }
.grade-tab--popular { background: #fff2bd; }
.grade-tab:hover { filter: brightness(.98); }
.grade-tab.is-active {
  border-color: #7fb3ef;
  color: #245c9e;
  box-shadow: 0 10px 28px rgb(50 107 173 / 15%);
}
.grade-tab.is-active::after {
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-top-color: #91b9eb;
  content: "";
  transform: translateX(-50%);
}
.grade-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.tab-illustration {
  position: absolute;
  z-index: 1;
  bottom: -2.1rem;
  width: clamp(105px, 15vw, 175px);
  pointer-events: none;
}
.tab-illustration--left { left: -2.5rem; }
.tab-illustration--right { right: -2.5rem; }

.award-section {
  position: relative;
  padding: clamp(1.35rem, 3.2vw, 3rem);
  border: 1px solid #e6eef5;
  border-radius: 30px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 18px 55px rgb(77 113 148 / 12%);
}
.section-decoration { position: absolute; z-index: 0; width: clamp(48px, 6vw, 80px); height: auto; opacity: .72; pointer-events: none; }
.section-decoration--bulb { top: -2.4rem; right: 3%; transform: rotate(8deg); }
.section-decoration--book { right: -1.5rem; top: 48%; transform: rotate(12deg); }
.award-section > :not(.section-decoration) { position: relative; z-index: 1; }
.award-section:focus { outline: none; }
.award-section:focus-visible { outline: 3px solid var(--focus); outline-offset: 10px; border-radius: 20px; }

.section-heading, .subsection-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .85rem;
  text-align: center;
}
.section-heading { position: relative; width: fit-content; margin-bottom: 2.4rem; padding: 0 .35rem .65rem; }
.section-heading::after {
  display: none;
}
.section-heading h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.25; letter-spacing: .04em; }
.heading-spark { color: #f6ad26; font-size: clamp(1.25rem, 3vw, 2rem); }

.top-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.winner-card {
  --rank: #d3a027;
  --rank-bg: #fff7d9;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rank) 28%, white);
  padding: .85rem;
  border-radius: 22px;
  background: var(--rank-bg);
  box-shadow: 0 14px 38px rgb(55 75 100 / 9%);
}
.winner-card[data-rank="2"] { --rank: #5b89aa; --rank-bg: #eaf5fb; }
.winner-card[data-rank="3"] { --rank: #b97947; --rank-bg: #fff0e5; }

.rank-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(80%, 230px);
  min-height: 52px;
  margin: -.85rem auto 0;
  gap: .45rem;
  color: color-mix(in srgb, var(--rank) 80%, #26374c);
  border-radius: 0 0 20px 20px;
  background: color-mix(in srgb, var(--rank-bg) 60%, white);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.rank-label::before { content: "♛"; color: var(--rank); font-size: 2rem; text-shadow: 0 2px 0 rgb(255 255 255 / 80%); }

.winner-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 1rem 0 0;
  border: 8px solid #fff;
  overflow: hidden;
  border-radius: 15px;
  background: #f5f3ef;
  padding: 0;
  cursor: zoom-in;
}
.winner-image { display: block; width: 100%; height: 100%; object-fit: contain; }

.winner-content { display: flex; flex: 1; flex-direction: column; padding: 1rem 0 0; }
.winner-school { margin: 0; color: #68798f; font-size: .95rem; font-weight: 700; text-align: center; }
.winner-name { margin: .1rem 0 .9rem; color: #273c5c; font-size: 1.35rem; text-align: center; }
.judge-comment { flex: 1; padding: 1rem; border: 1px solid rgb(255 255 255 / 85%); border-radius: 14px; background: rgb(255 255 255 / 62%); }
.comment-label { display: block; margin-bottom: .25rem; color: color-mix(in srgb, var(--rank) 80%, #273c5c); font-weight: 800; }
.judge-comment p { margin: 0; color: #485a70; }
.comment-list {
  margin: .25rem 0 0;
  padding-left: 1.25rem;
  color: #485a70;
}
.comment-list li + li { margin-top: .45rem; }
.comment-list li::marker { color: var(--rank); }

.honorable-section { margin-top: clamp(3rem, 7vw, 5rem); }
.subsection-heading { justify-content: flex-start; margin-bottom: 1.5rem; border-bottom: 2px solid #e6eef5; padding-bottom: .8rem; }
.subsection-heading span { color: #ec8b42; font-size: 1.7rem; transform: rotate(-12deg); }
.subsection-heading h2 { margin: 0; color: #314d73; font-size: clamp(1.4rem, 3vw, 2rem); }

.honorable-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.25rem; }
.honorable-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 6px 15px rgb(55 75 100 / 7%); }
.honorable-image-wrap { aspect-ratio: 4 / 3; background: #f6f5f2; }
.honorable-image-wrap { position: relative; display: block; width: 100%; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; }
.honorable-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.work-zoom { color: inherit; font: inherit; }
.zoom-hint {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  color: #fff;
  background: rgb(32 63 97 / 78%);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.4;
  opacity: 0;
  transition: opacity .18s ease;
}
.work-zoom:hover .zoom-hint, .work-zoom:focus-visible .zoom-hint { opacity: 1; }
.honorable-school { margin: 0; padding: .7rem .6rem 0; color: #748397; font-size: .86rem; font-weight: 700; text-align: center; }
.honorable-name { margin: 0; padding: .05rem .7rem .8rem; color: #334b6d; font-size: 1.05rem; font-weight: 800; text-align: center; }

.site-footer {
  width: 100%;
  margin-top: clamp(-1.5rem, -2vw, -.5rem);
  overflow: hidden;
  line-height: 0;
}

.site-footer img {
  display: block;
  width: 100%;
  height: auto;
}

.heading-medal { width: 40px; height: 40px; object-fit: contain; }

.reply-link {
  position: fixed;
  z-index: 20;
  top: 56%;
  right: 0;
  display: flex;
  align-items: center;
  padding: .75rem .65rem;
  gap: .45rem;
  border: 1px solid #dfc98f;
  border-right: 0;
  border-radius: 18px 0 0 18px;
  color: #6b5a38;
  background: #f8eac2;
  box-shadow: none;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.3;
  text-decoration: none;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}
.reply-link:hover { background: #f4dfaa; }
.reply-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.lightbox {
  width: min(94vw, 1200px);
  max-width: none;
  height: min(92vh, 900px);
  max-height: none;
  border: 0;
  border-radius: 22px;
  background: #fff;
  padding: 0;
  box-shadow: 0 24px 80px rgb(18 35 57 / 35%);
}
.lightbox::backdrop { background: rgb(24 38 57 / 82%); backdrop-filter: blur(3px); }
.lightbox-inner { position: relative; display: grid; height: 100%; grid-template-rows: minmax(0, 1fr) auto; padding: clamp(1rem, 3vw, 2rem); gap: .75rem; }
.lightbox-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lightbox-caption { margin: 0; color: #344d6d; font-weight: 800; text-align: center; }
.lightbox-close {
  position: absolute;
  z-index: 2;
  top: .65rem;
  right: .65rem;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(35 56 82 / 85%);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 1050px) {
  .tab-illustration { opacity: .72; }
  .tab-illustration--left { left: -1rem; }
  .tab-illustration--right { right: -1rem; }
  .honorable-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .awards-container { width: min(100% - 32px, 760px); }
  .tab-illustration { display: none; }
  .top-three { gap: .85rem; }
  .winner-content { padding-inline: 1rem; }
  .winner-image-wrap { margin-inline: .75rem; }
  .honorable-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-decoration--book { display: none; }
}

@media (max-width: 767px) {
  .hero > img:first-of-type { width: 100%; }
  .hero-actions { top: .5rem; right: .5rem; }
  .share-button { min-height: 40px; padding: .45rem .75rem; font-size: .88rem; }
  .hero-decoration { display: none; }
  .awards-container { width: min(100% - 28px, 560px); padding-top: 2.25rem; }
  .grade-tabs-wrap { margin-bottom: 2.8rem; }
  .grade-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .grade-tab { min-height: 58px; padding: .45rem .35rem; gap: .35rem; border-radius: 15px; font-size: clamp(.88rem, 4vw, 1rem); letter-spacing: 0; }
  .grade-tab img { width: 30px; height: 40px; }
  .grade-tab.is-active::after { display: none; }
  .award-section { padding: 1.2rem .85rem 1.8rem; border-radius: 22px; }
  .section-heading { margin-inline: auto; }
  .section-heading { gap: .4rem; }
  .section-heading h1 { font-size: clamp(1.35rem, 6.2vw, 1.65rem); white-space: nowrap; }
  .heading-spark { font-size: 1rem; }
  .top-three { grid-template-columns: 1fr; gap: 1.5rem; }
  .winner-card { width: 100%; }
  .winner-image-wrap { margin: 1rem 0 0; }
  .winner-content { padding: 1rem 1.15rem 1.25rem; }
  .honorable-section { margin-top: 4rem; }
  .honorable-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
  .honorable-name { font-size: 1rem; }
  .site-footer { margin-top: -1rem; }
  .section-decoration--bulb { width: 48px; top: -1.8rem; right: 1rem; opacity: .55; }
  .lightbox { width: 96vw; height: 88vh; border-radius: 16px; }
  .lightbox-inner { padding: .75rem; padding-top: 3.5rem; }
  .reply-link {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    min-height: 48px;
    padding: .4rem 1rem;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    letter-spacing: .04em;
    writing-mode: horizontal-tb;
    transform: none;
  }
}

@media (max-width: 480px) {
  .grade-tabs { gap: 7px; }
  .grade-tab { min-height: 54px; padding-inline: .3rem; font-size: .9rem; }
  .grade-tab img { display: block; width: 27px; height: 36px; }
}

@media (hover: none) {
  .zoom-hint { opacity: .88; }
}

@media (max-width: 360px) {
  .awards-container { width: calc(100% - 20px); }
  .grade-tab { font-size: .82rem; }
  .honorable-grid { gap: .6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .winner-card, .honorable-card { animation: reveal .32s ease both; }
  .honorable-card:nth-child(2n) { animation-delay: .03s; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
}
