/* =========================================================
   宮掌櫃 2026 模板設計競賽  —  styles
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --cream: #fbefcf;
  --cream-2: #fdf7e6;

  --ink: #5c3b23;
  --ink-soft: #7c5738;
  --ink-mute: #9a7a52;

  --red: #c33a20;
  --red-dark: #a52e1b;
  --orange: #e8631e;
  --coral: #e07a4e;
  --gold: #f2b233;

  --shadow-sm: 0 4px 14px rgba(120, 70, 25, .14);
  --shadow-md: 0 16px 36px rgba(120, 60, 20, .20);

  --radius: 22px;
  --nav-h: 74px;
  --maxw: 1280px;

  --font: "Klee One", "LXGW WenKai TC", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.75;
  background: #f6d180 url("Assets/模板比賽網站圖片/bg.png") top center / 100% auto repeat-y;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 2500px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   keyframes
   ========================================================= */

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

@keyframes sway {

  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(2deg);
  }
}

@keyframes twinkle {

  0%,
  100% {
    transform: scale(.8) rotate(-4deg);
    opacity: .5;
  }

  50% {
    transform: scale(1.12) rotate(6deg);
    opacity: 1;
  }
}

@keyframes swing {

  0%,
  100% {
    transform: rotate(-6deg);
  }

  50% {
    transform: rotate(6deg);
  }
}

@keyframes bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(12px);
  }
}

@keyframes drift {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(100vw + 340px));
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.1) rotate(-3deg);
  }

  100% {
    transform: scale(1);
  }
}

/* =========================================================
   nav
   ========================================================= */

.nav-outer {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  transition: top .3s ease;
}

.nav-outer.shrink {
  top: 6px;
}

.nav {
  width: min(940px, 100%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px 10px 18px;
  background: var(--cream);
  border: 2px solid #efdca8;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: padding .3s ease;
}

.nav-outer.shrink .nav {
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
}

.brand .logo {
  height: 50px;
  width: auto;
}

.brand .seal {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #E3623F;
  color: #ffe9c7;
  font-size: 19px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.brand .seal span {
  transform: translateY(1px);
}

.brand b {
  font-size: 18px;
  letter-spacing: .06em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-links a {
  font-family: Roboto;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: #91372A;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}

.nav-links a:hover {
  background: #f6e6bd;
  transform: translateY(-1px);
}

.nav-links a.active {

  background: #f2d9a6;
  color: var(--red-dark);
  font-weight: 600;
}

.btn-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #E3623F;
  color: #fff5e6 !important;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(200, 70, 20, .34);
  transition: transform .2s, filter .2s;
}

.btn-go:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
}

.btn-go .arr {
  transition: transform .25s;
}

/* 導覽列右側按鈕：投稿與投票同時開放時並列「前往投票」（次要）與「前往報名」（主要）（第 182 批） */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-go[hidden] {
  display: none;
}

.btn-go--secondary {
  background: #fff8ea;
  color: var(--red-dark) !important;
  box-shadow: inset 0 0 0 2px #E3623F;
}

.nav-actions .btn-go {
  white-space: nowrap;
}

/* 登入狀態（第 187 批）：已登入才顯示。桌機在導覽列右側「已登入・我的投票｜登出」；
   手機版（860px 以下）收合時只在選單按鈕左側顯示「已登入」，展開選單後最下方是「登出宮掌櫃會員」。 */
.nav-member,
.nav-member-compact {
  align-items: center;
  border: 1px solid #9fd6b1;
  border-radius: 999px;
  background: #e7f6ec;
  color: #1f7a3f;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-member {
  display: inline-flex;
}

.nav-member[hidden],
.nav-member-compact,
.nav-menu-logout {
  display: none;
}

.nav-member__link,
.nav-member-compact {
  gap: 6px;
  color: #1f7a3f;
  text-decoration: none;
}

.nav-member__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px 8px 14px;
}

.nav-member__link::before,
.nav-member-compact::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.nav-member__logout {
  padding: 8px 14px 8px 10px;
  border: 0;
  border-left: 1px solid #9fd6b1;
  background: none;
  color: #1f7a3f;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.nav-member__logout:disabled,
.nav-menu-logout:disabled {
  opacity: .5;
  cursor: wait;
}

@media (max-width: 860px) {
  .nav-member {
    display: none;
  }

  .nav-member-compact:not([hidden]) {
    display: inline-flex;
    margin-left: auto;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* 選單按鈕本身也是 margin-left: auto；有登入標示時改由標示推到右側，兩者只隔導覽列的 gap。 */
  .nav-member-compact:not([hidden]) + .nav-toggle {
    margin-left: 0;
  }

  .nav.open > .nav-menu-logout:not([hidden]) {
    display: block;
    width: 100%;
    margin-top: 2px;
    padding: 12px;
    border: 0;
    border-top: 1px solid #eadbc8;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
}

/* 桌機最窄（861～1000px）兩顆按鈕並列時縮小留白，避免換行 */
@media (min-width: 861px) and (max-width: 1000px) {
  .nav-actions {
    gap: 6px;
  }

  .nav-actions .btn-go {
    padding: 8px 12px;
    font-size: 14px;
  }
}

.btn-go:hover .arr {
  transform: translateX(4px);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #f2d9a6;
  color: var(--red-dark);
  font-size: 20px;
  cursor: pointer;
}

/* 桌機版選單置中：Logo 與「前往官網」寬度不同，用左右等寬的三欄網格讓選單對齊導覽列中心；
   手機版（860px 以下）維持原本的 flex 與漢堡選單。 */
@media (min-width: 861px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  /* Logo 是連到宮掌櫃網站的連結，不讓它撐滿整欄而擴大可點範圍。 */
  .brand {
    justify-self: start;
  }

  .nav-links {
    margin-left: 0;
    justify-self: center;
  }

  .nav>.nav-actions {
    justify-self: end;
  }
}

/* =========================================================
   page shell
   ========================================================= */

.cms-preview-banner {
  position: fixed;
  z-index: 80;
  right: 12px;
  bottom: 12px;
  left: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px;
  border: 2px solid #75400b;
  border-radius: 14px;
  background: #fff5d6;
  color: #653405;
  box-shadow: var(--shadow-md);
  font-weight: 700;
  text-align: center;
}

.cms-preview-banner[hidden] {
  display: none;
}

.cms-preview-banner[data-error="true"] {
  border-color: #b93a26;
  background: #fff0ea;
  color: #8d281a;
}

main {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageIn .5s ease;
}

.section {
  padding: 20px 0;
  position: relative;
}

.section.tight {
  padding: 0px 0;
}

/* first section on the home page — keep the whole 分組與獎項 block in one viewport */
.page[data-page="about"]>.hero+.section {
  padding-top: 32px;
  padding-bottom: 28px;
}

.deco-wrap {
  overflow: visible;
}

.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1),
    transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-sky,
  .deco,
  .section-arrow {
    animation: none !important;
  }
}

/* =========================================================
   hero
   ========================================================= */

/* 主辦與指導單位：窄螢幕等比例縮小，維持同列顯示。 */
.event-organizers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  min-height: 85px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .45);
}

.event-organizers__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-organizers__item--advisor {
  gap: 5px;
}

.event-organizers__label {
  flex-shrink: 0;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: normal;
  color: #000;
  white-space: nowrap;
}

.event-organizers__host {
  width: 245px;
  height: 70px;
  object-fit: contain;
}

.event-organizers__advisor {
  width: 220px;
  height: 60px;
  object-fit: contain;
}

/* 贊助單位（第 198 批）：主辦／指導單位的下一行，標誌一律自動往左輪播。
   標誌固定高度、限制最寬（扁長的標誌等比例縮小），直接放在底色上，和主辦、指導單位標誌同一種呈現。
   滑鼠移上去、手指按住、鍵盤移到標誌上都會暫停；「減少動態效果」時不動，改成可以左右滑。 */
/* 換行只在有贊助單位時打開（script.js 加上 --with-sponsors）：沒有贊助單位時，主辦／指導單位維持原本「縮小不換行」的排法。 */
.event-organizers--with-sponsors {
  flex-wrap: wrap;
  row-gap: 0;
}

.event-sponsors {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 0;
  border-top: 1px dashed rgba(0, 0, 0, .15);
}

.event-sponsors[hidden] {
  display: none;
}

/* 預設是靜態排列：標誌排成一行、每家一次，寬度跟著內容（標籤和標誌一起置中）；放不下時這一格可以左右滑動，不顯示捲軸。 */
.event-sponsors__window {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 820px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.event-sponsors__window::-webkit-scrollbar {
  display: none;
}

.event-sponsors__track {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 輪播（後台選「輪播」、且系統沒有要求減少動態效果時，script.js 才加上 --carousel）。
   軌道至少是這一格的兩倍寬、每個標誌等量放大，所以「一組」至少和這一格一樣寬：位移一半剛好接上，
   而且家數少時同一家不會同時出現好幾個。拿掉 min-width 或等量放大，家數少時位移一半會露出空白再跳回來。 */
.event-sponsors--carousel .event-sponsors__window {
  flex: 1 1 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.event-sponsors--carousel .event-sponsors__track {
  min-width: 200%;
  animation: event-sponsors-scroll var(--sponsor-duration, 28s) linear infinite;
}

.event-sponsors--carousel .event-sponsors__item {
  flex: 1 0 auto;
  justify-content: center;
}

.event-sponsors--carousel .event-sponsors__window:hover .event-sponsors__track,
.event-sponsors--carousel .event-sponsors__window:active .event-sponsors__track,
.event-sponsors--carousel .event-sponsors__window:focus-within .event-sponsors__track {
  animation-play-state: paused;
}

.event-sponsors__item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.event-sponsors__item a {
  display: flex;
  align-items: center;
  border-radius: 6px;
}

.event-sponsors__item a:focus-visible {
  outline: 2px solid #b5651d;
  outline-offset: 4px;
}

.event-sponsors__item img {
  display: block;
  width: auto;
  height: 56px;
  max-width: 220px;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

@keyframes event-sponsors-scroll {
  to {
    transform: translateX(-50%);
  }
}

/* 減少動態效果：script.js 不會加 --carousel，直接用上面的靜態排列，這裡不用另外處理。 */

@media (max-width: 1100px) {
  .event-sponsors {
    gap: 4px;
    padding: 7px 0;
  }

  .event-sponsors__item {
    padding: 0 14px;
  }

  .event-sponsors__item img {
    height: clamp(22px, 6.5vw, 40px);
    max-width: clamp(90px, 26vw, 160px);
  }
}

@media (max-width: 1100px) {
  .event-organizers {
    gap: clamp(8px, 3vw, 32px);
    min-height: 48px;
    padding: 8px 10px;
  }

  .event-organizers__item,
  .event-organizers__item--advisor {
    flex: 0 0 auto;
    gap: 4px;
  }

  .event-organizers__label {
    font-size: clamp(10px, 2.8vw, 18px);
  }

  .event-organizers__host {
    width: clamp(72px, 22vw, 140px);
    height: clamp(20.57px, 6.286vw, 40px);
  }

  .event-organizers__advisor {
    width: clamp(65px, 20vw, 126px);
    height: clamp(17.73px, 5.455vw, 34.36px);
  }
}

.hero {
  position: relative;
  padding: 40px 0 24px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% 0;
  z-index: 0;
  background: radial-gradient(60% 55% at 50% 42%,
      rgba(255, 244, 214, .85), rgba(255, 244, 214, 0) 70%);
}

.hero-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-sky img {
  position: absolute;
  opacity: .92;
  animation: floaty ease-in-out infinite;
}

.hero-sky .k1 {
  width: 250px;
  top: 6%;
  left: 1%;
  animation-duration: 7s;
}

.hero-sky .k2 {
  width: 200px;
  top: 1%;
  left: 24%;
  animation-duration: 8s;
  animation-delay: -2s;
}

.hero-sky .k3 {
  width: 280px;
  top: -2%;
  right: 4%;
  animation-duration: 9s;
  animation-delay: -1s;
}

.hero-sky .k4 {
  width: 210px;
  top: 22%;
  right: -2%;
  animation-duration: 7.5s;
  animation-delay: -3s;
}

.hero-sky .k5 {
  width: 240px;
  bottom: 0;
  left: -3%;
  animation-duration: 8.5s;
  animation-delay: -1.5s;
}

.hero-sky .k6 {
  width: 300px;
  bottom: -6%;
  left: 30%;
  animation-duration: 9.5s;
  animation-delay: -4s;
}

.hero-sky .k7 {
  width: 230px;
  bottom: -2%;
  right: 8%;
  animation-duration: 8s;
  animation-delay: -2.5s;
}

.hero-sky .k8 {
  width: 170px;
  top: 38%;
  left: 0;
  animation-duration: 7s;
  animation-delay: -3.5s;
}

.hero-sky .st {
  animation: twinkle ease-in-out infinite;
}

.hero-sky .t1 {
  width: 58px;
  top: 32%;
  left: 18%;
  animation-duration: 4.5s;
}

.hero-sky .t2 {
  width: 78px;
  top: 44%;
  right: 16%;
  animation-duration: 5.5s;
  animation-delay: -1s;
}

.hero-sky .t3 {
  width: 48px;
  bottom: 20%;
  left: 24%;
  animation-duration: 4s;
  animation-delay: -2s;
}

.hero-art {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1650px;
  margin: -24px auto 0;
  animation: floaty 6s ease-in-out infinite;
  filter: drop-shadow(0 18px 26px rgba(150, 80, 20, .22));
}

/* =========================================================
   scroll headers  (標題.png)
   ========================================================= */

.scroll-head {
  position: relative;
  width: min(600px, 90%);
  margin: 0 auto 24px;
  aspect-ratio: 653 / 367;
  display: grid;
  place-items: center;
}

.scroll-head .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(150, 80, 20, .22));
  animation: sway 7s ease-in-out infinite;
}

.scroll-head span {
  font-family: "RocknRoll One", "Klee One", "Noto Sans TC", sans-serif;
  font-style: normal;
  position: relative;
  z-index: 1;
  transform: translateY(-9%);
  color: #c0301c;
  font-weight: 500;
  -webkit-text-stroke: 0.75px currentColor;
  letter-spacing: .14em;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  text-shadow: 0 1px 0 #fff2d5;
}

.scroll-head .deco {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: min(180px, 23vw);
  display: block;
}

.scroll-head .deco.l {
  left: -17%;
}

.scroll-head .deco.r {
  right: -17%;
}

.scroll-head .deco img {
  width: 100%;
  animation: twinkle 5s ease-in-out infinite;
}

.scroll-head .deco.r img {
  animation-delay: -1s;
  animation-duration: 5.5s;
}

.scroll-head .deco.puff img {
  animation: floaty 6s ease-in-out infinite;
}

.scroll-head .deco.pop img {
  animation: swing 3.2s ease-in-out infinite;
}

.section-arrow {
  position: absolute;
  z-index: 3;
  width: 115px;
  top: 2px;
  left: 20%;
  animation: bob 1.6s ease-in-out infinite;
}

.section-arrow.left {
  left: auto;
  right: 20%;
}

/* =========================================================
   section heading  (h2)
   ========================================================= */

.h2 {
  font-family: "RocknRoll One", "Klee One", "Noto Sans TC", sans-serif;
  text-align: center;
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 400;
  letter-spacing: .1em;
  color: #e8631e;
  /* coral fill */
  -webkit-text-stroke: 4px #fff;
  /* clean white outline */
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(150, 55, 20, .16);
  margin: 0 0 26px;
  position: relative;
}

.h2.stars::before,
.h2.stars::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 66px;
  height: 66px;
  background: url("Assets/模板比賽網站圖片/star-1.png") center / contain no-repeat;
  transform: translateY(-50%);
  animation: twinkle 5s ease-in-out infinite;
}

.h2.stars::before {
  left: calc(50% - 240px);
}

.h2.stars::after {
  right: calc(50% - 240px);
  animation-delay: -1.4s;
}

.lead {
  font-family: Noto Sans HK;
  font-weight: 500;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: #91372A;
  font-size: 1.5rem;
}

/* =========================================================
   group badges
   ========================================================= */

.groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 66px;
  max-width: 1200px;
  margin: 0 auto 10px;
}

.groups img {
  height: 88px;
  width: auto;
  transition: transform .25s;
}

.groups img:hover {
  transform: translateY(-6px) rotate(-2deg) scale(1.06);
}

/* =========================================================
   podium / prizes
   ========================================================= */

.podium-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
  max-width: 1220px;
  margin: 20px auto 0;
}

.podium-block .podium {
  width: 460px;
  max-width: 82vw;
  animation: floaty 7s ease-in-out infinite;
}

.prize-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.prize-title {
  margin: 0 0 4px;
  font-family: "RocknRoll One", "Klee One", "Noto Sans TC", sans-serif;
  color: #e8631e;
  /* orange fill */
  -webkit-text-stroke: 4px #fff;
  /* white outline */
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(150, 55, 20, .18);
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: .05em;
}

.prize {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .2s;
}

.prize:hover {
  transform: translateX(6px);
}

.prize .medal {
  width: 58px;
  flex: none;
}

.prize .rank {
  /* nhãn "第一名" — chỉ hiện ở mobile */
  display: none;
  font-family: Noto Sans HK;
  font-weight: 700;
  color: #91372A;
  font-size: 1.2rem;
}

.prize .amt {
  font-family: "Protest Strike", "RocknRoll One", "Klee One", sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  color: #fff;
  /* white fill */
  -webkit-text-stroke: 4px #e8631e;
  /* orange outline */
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(150, 55, 20, .18);
  letter-spacing: .01em;
}

.prize .amt small {
  font-family: "Noto Sans TC", "Klee One", sans-serif;
  font-size: 1.3rem;
  color: #fff;
  -webkit-text-stroke: 2.4px #e8631e;
  paint-order: stroke fill;
  margin-left: 6px;
}

.podium-block .lantern {
  width: 158px;
  align-self: flex-start;
  margin-top: 255px;
  transform-origin: top center;
  animation: swing 4s ease-in-out infinite;
}

/* =========================================================
   theme awards
   ========================================================= */

/* các phần chỉ hiện ở mobile — mặc định ẩn (desktop giữ nguyên) */
.scroll-head.m-only,
.theme .theme-name,
.special-mobile,
.demo-block .demo-m,
.rule .formula .flbl-m {
  display: none;
}

.theme-row {
  display: grid;
  gap: 60px;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1080px;
  margin: 0 auto;
}

.theme {
  margin: 0;
  text-align: center;
}

.theme img {
  width: 550px;
  max-width: 100%;
  margin: 0 auto 14px;
  transition: transform .3s;
}

.theme:hover img {
  animation: pop .55s ease;
}

.theme figcaption {
  font-family: Noto Sans HK;
  color: var(--red-dark);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.7;
}

/* 只讓名額那一行換行；金額等其他 span 維持行內，才不會被拆成多行。 */
.theme figcaption .theme-places {
  display: block;
}

/* =========================================================
   special awards
   ========================================================= */

.special-row {
  display: grid;
  gap: 60px;
  grid-template-columns: repeat(2, 1fr);
  max-width: 960px;
  margin: 0 auto;
}

.special {
  margin: 0;
  text-align: center;
}

.special img {
  width: 280px;
  max-width: 74%;
  margin: 0 auto 14px;
  transition: transform .3s;
}

.special:hover img {
  transform: translateY(-8px) scale(1.04);
}

.special figcaption {
  font-family: Noto Sans HK;
  color: var(--red-dark);
  font-weight: 600;
  line-height: 2;
  font-size: 1.15rem;
}

.special figcaption b {
  display: block;
  color: var(--red-dark);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

/* =========================================================
   info card  (timeline + steps)
   ========================================================= */

.info-card {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 252, 244, .72);
  border: 2px solid #f0deb0;
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  padding: 20px 56px;
}

.tl-row {
  display: grid;
  grid-template-columns: 210px 90px 1fr;
  align-items: center;
  gap: 14px;
  padding: 26px 8px;
  border-bottom: 1px solid rgba(150, 110, 60, .22);
}

.tl-row:last-child {
  border-bottom: none;
}

.tl-row .d {
  font-family: RocknRoll One;
  color: #E73B22;
  font-weight: 500;
  font-size: 1.2rem;
}

/* 時程分隔：細線取代「————」字元，讀屏不再念破折號（UI D-27）。 */
.tl-row .sep {
  display: block;
  height: 0;
  border-top: 1.5px solid #caa870;
}

.tl-row .t {
  font-family: Noto Sans HK;
  font-weight: 700;
  color: #612E09;
  font-size: 1.12rem;
}

.steps-card {
  display: flex;
  padding: 0;
  background: #d5593b;
  border-color: #fff;
  box-shadow: 0 16px 32px rgba(150, 60, 25, .22);
}

.step-col {
  flex: 1;
  text-align: center;
  padding: 34px 20px;
  border-left: 1.5px solid rgba(255, 255, 255, .35);
}

.step-col:first-child {
  border-left: none;
}

.step-col b {
  display: block;
  font-family: Noto Sans HK;
  color: #fff;
  font-size: 2.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  transition: transform .25s;
}

.step-col:hover b {
  transform: translateY(-4px) scale(1.1);
}

.step-col p {
  margin: 0;
  font-family: Noto Sans HK;
  font-weight: 500;
  color: #fff;
  font-size: 1.18rem;
}

/* =========================================================
   demo blocks
   ========================================================= */

.pill-btn {
  display: block;
  width: max-content;
  max-width: 92%;
  margin: 26px auto 52px;
  padding: 14px 34px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #E3623F;
  font-weight: 600;
  font-size: 1.15rem;
  transition: background .25s, color .25s, transform .2s;
}

.pill-btn:hover {
  background: #E3623F;
  color: #fff4e6;
  border-color: #fff;
  transform: translateY(-2px);
}

.demo-block {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 1fr;
  gap: 52px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 56px;
}

.demo-block:last-child {
  margin-bottom: 0;
}

.demo-block img {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  transition: transform .3s;
}

.demo-block:hover img {
  transform: translateY(-6px);
}

.demo-block h3 {
  font-family: Noto Sans HK;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--red-dark);
  font-size: 1.5rem;
  letter-spacing: .04em;
}

.demo-block p {
  font-family: Noto Sans HK;
  font-weight: 500;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 2;
}

.demo-block p b {
  font-weight: 700;
  color: #E3623F;
  /* hoặc màu bạn muốn nhấn */
}

.demo-block.reverse img {
  order: 2;
}

/* =========================================================
   rules
   ========================================================= */

.rules-row {
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(2, 1fr);
  max-width: 1080px;
  margin: 0 auto;
}

.rule {
  text-align: center;
}

.rule h3 {
  font-family: RocknRoll One;
  margin: 0 0 18px;
  color: #E73B22;
  letter-spacing: .08em;
  font-size: 2rem;
  font-weight: 500;
}

.rule .formula {
  font-family: "Protest Strike", "RocknRoll One", "Klee One", sans-serif;
  margin: 0 0 22px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

/* shared LOOK (white fill + orange outline) for every big sticker glyph */
.rule .formula .fnum,
.rule .formula .fmark,
.rule .formula .plus,
.rule .formula .flbl {
  font-weight: 800;
  color: #fff;
  /* white fill */
  -webkit-text-stroke: 10px #E3623F;
  /* orange outline */
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(150, 55, 20, .18);
}

/* ---- SIZES — chỉnh riêng từng phần ở đây ---- */
.rule .formula .fnum {
  font-size: clamp(2.4rem, 6vw, 4rem);
}

/* số 80 / 20 */
.rule .formula .fmark {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

/* dấu %      */
.rule .formula .plus {
  font-size: clamp(2.6rem, 5vw, 3.8rem);
}

/* dấu ＋     */
.rule .formula .flbl {
  font-size: 1.5rem;
}

/* 評分 / 人氣 */

/* "% + nhãn" là 1 khu riêng để nhãn nằm chồng lên trên dấu % */
.rule .formula .fpct {
  position: relative;
  display: inline-block;
  margin: 0 .34em;
  /* nới rộng khoảng 2 bên dấu % (giữa số 80 và ＋) */
}

.rule .formula .fmark {
  position: relative;
  /* nằm trong dòng, là mốc cho nhãn */
}

.rule .formula .plus {
  margin: 0 .12em;
}

/* nhãn 評分 / 人氣 — xếp hẳn trên đầu dấu % */
.rule .formula .flbl {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: .04em;
  /* +: đẩy lên cao, nằm hẳn trên đỉnh % */
  -webkit-text-stroke-width: 10px;
  /* nhỏ hơn nên viền mảnh hơn */
  letter-spacing: .02em;
  white-space: nowrap;
}

/* body paragraphs read left-aligned like the design */
.rule>p:not(.formula),
.rule-box p {
  font-family: Noto Sans HK;
  font-weight: 500;
  margin: 8px 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.95;
  text-align: left;
}

.rule>p:not(.formula) {
  max-width: 30em;
  margin-left: auto;
  margin-right: auto;
}

/* bordered box around 複賽 time / place */
.rule-box {
  border: 2px solid #612E09;
  border-radius: 14px;
  padding: 16px 22px;
  margin: 4px auto 16px;
  max-width: 30em;
  background: rgba(255, 255, 255, .28);
}

.rule-box p {
  margin: 4px 0;
  color: #612E09;
  font-weight: 500;
}

/* =========================================================
   q&a
   ========================================================= */

.qa-section {
  padding-bottom: 40px;
}

.qa-text {
  font-family: Noto Sans HK;
  color: #91372A;
  font-weight: 600;
  font-size: 1.3rem;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.qa-text .q {
  margin: 25px 0 8px;
}

.qa-text .q:first-child {
  margin-top: 0;
}

.qa-text p {
  margin: 0;
}

.ingot {
  position: absolute;
  left: 5%;
  bottom: -6px;
  width: 190px;
  z-index: 2;
  animation: floaty 6s ease-in-out infinite;
}

/* =========================================================
   crayon box  (vote page)
   ========================================================= */

.crayon {
  font-family: Noto Sans HK;
  width: min(560px, 92%);
  margin: 50px auto;
  text-align: center;
  padding: 22px 26px;
  color: #CB352B;
  background: rgba(255, 249, 232, .6);
  border: 3px dashed var(--orange);
  border-radius: 22px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .25), var(--shadow-sm);
}

.crayon strong {
  font-size: 1.3rem;
  font-weight: 700;
}

.crayon text {
  font-size: 1.2rem;
  font-weight: 600;
}

/* 投票公平性聲明：接在投票規則下方，長段落靠左較好讀，標題維持置中 */
.crayon__notice {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed rgba(203, 53, 43, .35);
  text-align: left;
}

.crayon__notice strong {
  display: block;
  text-align: center;
  font-size: 1.1rem;
}

/* =========================================================
   banner  (vote / winners page)
   ========================================================= */

/* constrain the inner container on the vote / winners pages
   (the home page uses a very wide .wrap on purpose) */
.page[data-page="vote"]>.section>.wrap {
  max-width: 1200px;
}

.page[data-page="winners"]>.section>.wrap {
  max-width: 820px;
}

.banner {
  position: relative;
  width: min(820px, 94%);
  margin: 12px auto 4px;
  aspect-ratio: 653 / 367;
  /* hộp đúng tỉ lệ cuộn → cuộn to & chữ nằm gọn bên trong */
  display: grid;
  place-items: center;
}

.banner .scroll-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  filter: drop-shadow(0 16px 24px rgba(150, 80, 20, .22));
  animation: sway 7s ease-in-out infinite;
}

.banner h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  transform: translateY(-9%);
  /* nhích lên đúng vùng giấy của cuộn */
  font-family: "RocknRoll One", "Klee One", "Noto Sans TC", sans-serif;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 500;
  letter-spacing: .14em;
  color: #b0281b;
  text-shadow: 0 2px 0 #fff3d9, 0 0 18px rgba(255, 240, 200, .8);
}

.banner .deco {
  position: absolute;
  z-index: 2;
  width: min(210px, 26vw);
  /* mây to hơn */
}

.banner .deco.l {
  left: -11%;
  bottom: 8%;
  animation: floaty 6s ease-in-out infinite;
}

.banner .deco.r {
  right: -11%;
  bottom: 8%;
  transform: scaleX(-1);
  animation: floaty 6.5s ease-in-out infinite;
  animation-delay: -1.5s;
}


/* winners banner uses sparkles — position higher & twinkle */
.page[data-page="winners"] .banner .deco.l {
  bottom: auto;
  top: 34%;
  left: -58px;
  width: 118px;
  transform: none;
  animation: twinkle 5s ease-in-out infinite;
}

.page[data-page="winners"] .banner .deco.r {
  bottom: auto;
  top: -6px;
  right: -58px;
  width: 118px;
  transform: none;
  animation: twinkle 5.5s ease-in-out infinite;
  animation-delay: -1s;
}

/* =========================================================
   vote page
   ========================================================= */

.tabs {
  font-family: Noto Sans HK;
  font-weight: 400;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.tab {
  border: 1.5px solid #E3623F;
  background: #fffdf7;
  color: var(--ink-soft);
  padding: 9px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
}

.tab:hover {
  transform: translateY(-2px);
  background: #e5b789;
  color: #fff;
}

.tab.active {
  background: #E3623F;
  color: #fff;
  border: 1.5px solid #fff;
  font-weight: 600;
}

.tab.sep {
  border: none;
  background: none;
  color: #d9b98e;
  padding: 9px 2px;
  cursor: default;
}

.tab.sep:hover {
  transform: none;
}

.vote-grid {
  display: grid;
  gap: 26px 24px;
  grid-template-columns: repeat(4, 1fr);
}

.vcard {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  /* để mảng ảnh tràn sát mép, bo theo góc thẻ */
  box-shadow: 0 6px 18px rgba(120, 70, 25, .12);
  transition: transform .28s, box-shadow .28s;
  /* 卡片上下排列，票數以下貼齊卡片底部，同一列不論標題幾行都對齊。 */
  display: flex;
  flex-direction: column;
}

.vcard:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.vcard .thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  aspect-ratio: 5 / 3;
  /* 縮圖固定比例，載入前灰底（UI D-36）。卡片是 flex 欄，沒有 min-height:0 時縮圖會被圖片撐高約 6px、比例跑掉。 */
  min-height: 0;
  background: #ece6dc;
  position: relative;
}

.vcard .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vote-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 249, 232, .8);
  border-radius: 18px;
  padding: 32px 20px;
}

.vote-state button {
  display: block;
  margin: 16px auto 0;
  padding: 9px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.vcard .info {
  padding: 18px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 組別、署名 14px、顏色加深到對比 4.5:1 以上（UI D-5）。 */
.vcard .cat {
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

.vcard h3 {
  margin: 6px 0 4px;
  font-size: 1.08rem;
  color: var(--ink);
  /* 固定留兩行高，一行的標題下面空一行，同一列的署名也對齊（2lh 不支援時退回行高 1.75 換算）。 */
  min-height: 3.5em;
  min-height: 2lh;
}

.vcard .author {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.vcard .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 推到卡片底部；署名換行時票數以下仍對齊。 */
  margin-top: auto;
}

.vcard .votes {
  font-weight: 600;
  color: var(--red);
  font-size: .95rem;
}

.vcard .pill {
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1.5px solid #e6b3aa;
  color: #c4756a;
}

.vcard .pill.open {
  border-color: #8fc3a3;
  color: #4a9068;
}

.vcard .vote-action {
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.vcard .vote-action:disabled {
  background: #ddd5ca;
  color: var(--ink-mute);
  cursor: not-allowed;
}

/* 作品詳情改成文字連結，卡片只留「投這件作品」一顆主按鈕（UI D-7）。 */
.vcard .detail-action {
  display: block;
  margin: 10px auto 0;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.vcard .detail-action:hover {
  color: var(--orange);
}

.vcard .title-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  /* 長名稱（含沒有空白的英文字串）最多兩行，超出顯示「…」；完整名稱放在 h3 的 title。
     兩行限制要設在按鈕本身：設在外層 h3 時按鈕是單一行內方塊、限制不作用，長名稱會顯示三行以上。 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.vcard .title-link:hover {
  color: var(--orange);
}

/* 換頁載入中的骨架卡片（UI D-11） */
.vcard--skeleton {
  box-shadow: none;
  pointer-events: none;
}

.vcard--skeleton .thumb {
  aspect-ratio: 5 / 3;
  background: #ece6dc;
}

.vcard--skeleton .sk-line,
.vcard--skeleton .sk-button {
  display: block;
  height: 14px;
  margin-top: 10px;
  border-radius: 7px;
  background: #ece6dc;
  animation: sk-pulse 1.2s ease-in-out infinite;
}

.vcard--skeleton .sk-line--short {
  width: 50%;
}

.vcard--skeleton .sk-button {
  height: 40px;
  margin-top: 18px;
  border-radius: 999px;
}

@keyframes sk-pulse {
  50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .vcard--skeleton .sk-line,
  .vcard--skeleton .sk-button {
    animation: none;
  }
}

/* 隱私權說明 */
.privacy-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.privacy-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.privacy-dialog .privacy-text {
  white-space: pre-line;
  font-size: .95rem;
}

/* 開站提示圖：寬圖完整顯示，手機點圖開原圖放大（.vote-dialog 寬度與留白寫在後面，這裡要更具體才蓋得過） */
.vote-dialog.notice-popup {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 52px 20px 20px;
}

.notice-popup__link {
  display: block;
  cursor: zoom-in;
}

.notice-popup__link img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 220px);
  object-fit: contain;
  border-radius: 12px;
}

.vote-dialog .notice-popup__hint {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .85rem;
  text-align: center;
}

.notice-popup__actions {
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.notice-popup__skip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.notice-popup__skip input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
}

.consent-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.consent-dialog__text {
  max-height: 45dvh;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

.consent-dialog__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  font-weight: 600;
  cursor: pointer;
}

.consent-dialog__check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: .25em;
}

/* 投票前必須勾選同意，未勾選時按鈕不可按，不是處理中 */
.consent-dialog .vote-dialog__actions button:disabled {
  cursor: not-allowed;
}

/* 搜尋與排序 */
.vote-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin: 0 0 24px;
}

.vote-filter label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vote-filter__search {
  flex: 1 1 260px;
}

.vote-filter__sort {
  flex: 0 0 auto;
}

/* 搜尋、排序標籤 14px 加深（UI D-13）。 */
.vote-filter__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.vote-filter input,
.vote-filter select {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid #e6d3bf;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

/* 排序選單改用自訂箭頭：內建箭頭貼著圓角右緣，與外框對不齊。 */
.vote-filter select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237c5738' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.vote-filter input:focus,
.vote-filter select:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .vote-filter__sort {
    flex: 1 1 100%;
  }
}

/* 手機版篩選：「篩選」按鈕、條件列只在 820px 以下顯示（見下方手機版區塊）。 */
.vote-filter__open,
.vote-filter-summary {
  display: none;
}

.vote-filter__open {
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid #E3623F;
  border-radius: 999px;
  background: #fffdf7;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.vote-filter-summary {
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
}

.vote-filter-summary__chip {
  padding: 4px 12px;
  border: 1px solid #f0c9a8;
  border-radius: 999px;
  background: #fff3e6;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.vote-filter-summary__rules {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--red-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

/* 篩選面板：從底部滑出的原生對話框，點面板外（對話框本身）關閉。 */
.filter-sheet {
  width: 100%;
  max-width: none;
  max-height: 85vh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.filter-sheet::backdrop {
  background: rgba(60, 35, 20, .45);
}

.filter-sheet__panel {
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #fffdf7;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  animation: filter-sheet-up .22s ease-out;
}

@keyframes filter-sheet-up {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.filter-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-sheet__head h2 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}

.filter-sheet__close {
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 18px;
  cursor: pointer;
}

.filter-sheet__label {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.filter-sheet__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-sheet__grid button {
  min-height: 44px;
  padding: 8px 6px;
  border: 1.5px solid #E3623F;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.filter-sheet__grid button[aria-pressed="true"] {
  background: #E3623F;
  color: #fff;
  font-weight: 600;
}

.filter-sheet__grid [data-sheet-group="all"] {
  grid-column: 1 / -1;
}

@media (prefers-reduced-motion: reduce) {
  .filter-sheet__panel {
    animation: none;
  }
}

/* 我的投票 */
.my-votes {
  margin: 0 0 28px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(255, 249, 232, .9);
  box-shadow: var(--shadow-md);
}

.my-votes h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--ink);
}

/* 我的投票標題旁的登入狀態標籤（第 187 批），載入登入狀態前隱藏。 */
.my-votes__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 2px 10px;
  border: 1px solid #ddd2c6;
  border-radius: 999px;
  background: #f3eee8;
  color: #6f5d4e;
  font-size: 12.5px;
  font-weight: 600;
  vertical-align: 2px;
}

.my-votes__status[hidden] {
  display: none;
}

.my-votes__status--in {
  border-color: #9fd6b1;
  background: #e7f6ec;
  color: #1f7a3f;
}

.my-votes__status--in::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.my-votes__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* 登出在區塊下方，點擊區域至少 44px 高（UI D-23）。 */
.my-votes__logout {
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  background: none;
  padding: 10px 0;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  cursor: pointer;
}

.my-votes__logout:disabled {
  opacity: .5;
  cursor: wait;
}

.my-votes__error {
  margin: 10px 0 0;
  color: #b42318;
  font-size: .9rem;
}

.my-votes ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-votes li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: .92rem;
}

.my-votes__group {
  color: var(--ink-mute);
}

.my-votes__done {
  color: var(--red);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.my-votes__none {
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .my-votes ul {
    grid-template-columns: 1fr;
  }
}

/* 確認投票：作品圖卡與組別 */
.vote-dialog__work {
  margin: 0 0 14px;
}

.vote-dialog__work img[hidden],
.work-dialog__image[hidden] {
  display: none;
}

.vote-dialog__work img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
  background: #f4ede2;
}

.vote-dialog__work figcaption {
  margin-top: 8px;
  font-size: .9rem;
  color: var(--ink-mute);
}

/* 作品詳情 */
.work-dialog {
  /* 必須是 fixed（瀏覽器對 modal dialog 的預設）：改成 relative／absolute 時，內容短的作品在視窗上滾輪會連背景一起捲，視窗被捲出畫面（QC R5）。 */
  position: fixed;
  overscroll-behavior: contain;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: auto;
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.work-dialog::backdrop {
  background: rgba(28, 20, 14, .6);
}

.work-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.work-dialog__image {
  margin: 0;
  background: #f4ede2;
  text-align: center;
}

.work-dialog__image img {
  display: block;
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
}

.work-dialog__image a {
  display: inline-block;
  padding: 8px 12px;
  font-size: .85rem;
  color: var(--orange);
}

.work-dialog__body {
  padding: 20px 24px 24px;
}

.work-dialog__cat {
  margin: 0;
  font-size: .85rem;
  color: var(--ink-mute);
}

.work-dialog__body h2 {
  margin: 6px 0 4px;
  font-size: 1.3rem;
  overflow-wrap: anywhere;
}

.work-dialog__author {
  margin: 0 0 14px;
  font-size: .9rem;
  color: var(--ink-mute);
}

.work-dialog__notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fbe9e5;
  color: #a2422f;
}

.work-dialog__desc {
  margin: 0;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.work-dialog__preview {
  display: inline-block;
  margin: 0 0 12px;
  font-size: .9rem;
  color: var(--orange);
}

.work-dialog__preview[hidden] {
  display: none;
}

.work-dialog__votes {
  margin: 14px 0 0;
  font-weight: 600;
  color: var(--red);
}

.work-dialog .vote-action {
  width: 100%;
  margin-top: 16px;
  padding: 11px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.work-dialog .vote-action:disabled {
  background: #ddd5ca;
  color: var(--ink-mute);
  cursor: not-allowed;
}

.vote-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.vote-dialog::backdrop {
  background: rgba(28, 20, 14, .6);
}

.vote-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.vote-dialog p {
  margin: 0;
  line-height: 1.7;
}

.vote-dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.vote-dialog__actions button {
  padding: 10px 18px;
  border: 1px solid var(--orange);
  border-radius: 999px;
  background: #fff;
  color: var(--orange);
  font: inherit;
  cursor: pointer;
}

.vote-dialog__actions button:last-child:not([hidden]) {
  background: var(--orange);
  color: #fff;
}

.vote-dialog__actions button:disabled {
  opacity: .6;
  cursor: wait;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
}

.pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: #fffdf7;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(120, 70, 25, .14);
  transition: transform .18s;
}

.pager button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.pager button.active {
  background: #f1dcae;
  color: var(--red-dark);
  font-weight: 600;
}

/* prev / next arrows */
.pager button[data-go="prev"],
.pager button[data-go="next"] {
  background: #e0562f;
  color: #fff4e8;
  font-size: 18px;
}

.pager .pager-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-size: 1.2em;
  transform: translateY(-4px);
}

/* 停用的上一頁／下一頁：灰底灰字、禁止游標，和橘色的目前頁碼明顯不同（UI D-9）。 */
.pager button:disabled {
  background: #ececec;
  border-color: #d6d6d6;
  color: #9a9a9a;
  box-shadow: none;
  cursor: not-allowed;
}

.pager .gap {
  background: none;
  box-shadow: none;
  cursor: default;
}

/* =========================================================
   winners page
   ========================================================= */

.win-section {
  margin-bottom: 64px;
}

.win-section h2 {
  font-family: RocknRoll One;
  text-align: center;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 500;
  color: #e8631e;
  paint-order: stroke fill;
  -webkit-text-stroke: 5px #fff;
  letter-spacing: .1em;
  color: var(--coral);
  margin: 0 0 26px;
  text-shadow: 0 2px 0 #fff5e0;
}

.tbl-wrap {
  overflow-x: auto;
}

table.win {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-family: RocknRoll One;
  font-weight: 350;
  font-size: 1.3rem;
}

table.win th,
table.win td {
  padding: 15px 16px;
  text-align: left;
}

table.win thead th {
  color: var(--red);
  font-weight: 600;
  letter-spacing: .06em;
  border-bottom: 1.5px solid rgba(165, 55, 25, .55);
}

table.win tbody td {
  border-bottom: 1px solid rgba(120, 80, 45, .22);
  color: #4a3320;
}

table.win tbody tr {
  transition: background .2s;
}

table.win tbody tr:hover {
  background: rgba(255, 255, 255, .45);
}

table.win .r {
  text-align: right;
}

.note-box {
  width: min(520px, 92%);
  margin: 8px auto 0;
  text-align: center;
  padding: 26px;
  color: var(--red-dark);
  font-size: 1.1rem;
  background: rgba(255, 249, 232, .6);
  border: 3px dashed var(--orange);
  border-radius: 22px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .25), var(--shadow-sm);
}

.note-box:has(ol) {
  width: min(900px, 96%);
  text-align: left;
}

.note-box h3 {
  margin: 18px 0 8px;
  color: var(--red-dark);
}

.note-box ol {
  margin: 0 0 12px;
  padding-left: 1.7em;
}

.note-box li {
  padding: 5px 0;
}

/* 領獎須知（後台「活動頁內容與素材」第 9 步）：所有獎項共用、靠左、保留後台換行；內容留空時整個區塊（含標題）不顯示。 */
.note-box.claim-notice {
  width: min(720px, 96%);
  text-align: left;
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-line;
}

.claim-section:has(.claim-notice:empty) {
  display: none;
}

/* =========================================================
   footer
   ========================================================= */

footer {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  background: #1c1712;
  color: #cdbfae;
  padding: 44px 0 26px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 80px;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 880px;
  /* giữ 2 khối gần giữa, không dạt ra sát mép trang */
}

footer .f-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

footer .f-brand .logo {
  height: 50px;
  width: auto;
}

footer .f-brand .seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #E3623F;
  color: #ffe9c7;
  font-size: 20px;
}

footer .f-brand b {
  font-size: 20px;
  letter-spacing: .08em;
  color: #e9ddcb;
}

footer .f-contact {
  text-align: right;
  font-size: 14px;
  line-height: 1.95;
}

footer .f-contact .lbl {
  color: #fff;
  letter-spacing: .1em;
}

footer .copy {
  text-align: center;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 13px;
  color: #8f8172;
}

/* =========================================================
   responsive
   ========================================================= */

@media (max-width: 1360px) {
  .groups {
    gap: 22px 48px;
  }

  .podium-block {
    gap: 44px;
  }
}

/* short viewports — keep the whole 分組與獎項 block on screen */
@media (min-width: 900px) and (max-height: 940px) {
  .page[data-page="about"]>.hero+.section {
    padding-top: 26px;
    padding-bottom: 30px;
  }

  .scroll-head {
    width: min(540px, 88%);
    margin-bottom: 12px;
  }

  .scroll-head span {
    font-size: clamp(1.8rem, 4vw, 2.45rem);
  }

  .scroll-head .deco {
    width: min(158px, 21vw);
  }

  .groups img {
    height: 80px;
  }

  .groups {
    margin-bottom: 6px;
  }

  .podium-block {
    margin-top: 12px;
    gap: 52px;
  }

  .podium-block .podium {
    width: 405px;
  }

  .prize-list {
    gap: 15px;
  }

  .prize-title {
    font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  }

  .prize .amt {
    font-size: 2.6rem;
    -webkit-text-stroke-width: 2.6px;
  }

  .prize .medal {
    width: 54px;
  }

  .podium-block .lantern {
    width: 144px;
  }
}

/* very short viewports */
@media (min-width: 900px) and (max-height: 780px) {
  .page[data-page="about"]>.hero+.section {
    padding-top: 16px;
    padding-bottom: 20px;
  }

  .scroll-head {
    width: min(420px, 82%);
    margin-bottom: 10px;
  }

  .groups img {
    height: 62px;
  }

  .groups {
    margin-bottom: 2px;
  }

  .podium-block {
    margin-top: 8px;
  }

  .podium-block .podium {
    width: 320px;
  }

  .prize .amt {
    font-size: 2.1rem;
    -webkit-text-stroke-width: 2.2px;
  }

  .prize .medal {
    width: 42px;
  }

  .podium-block .lantern {
    width: 104px;
  }
}

@media (max-width: 1120px) {
  .groups {
    gap: 20px 32px;
  }

  .podium-block {
    gap: 28px;
  }
}

@media (max-width: 1000px) {
  .theme-row {
    gap: 28px;
  }

  .demo-block {
    gap: 36px;
  }
}

/* vote card grid — số cột theo bề rộng */
@media (max-width: 1080px) {
  .vote-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .vote-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .vote-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .theme-row {
    grid-template-columns: 1fr;
    max-width: 380px;
    gap: 40px;
  }

  .special-row {
    grid-template-columns: 1fr;
    max-width: 400px;
    gap: 44px;
  }

  .rules-row {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 520px;
  }

  .rule .formula .fnum,
  .rule .formula .fmark {
    font-size: clamp(2.4rem, 10vw, 3.2rem);
    -webkit-text-stroke-width: 4px;
  }

  .rule .formula .plus {
    font-size: clamp(2rem, 8vw, 2.8rem);
    -webkit-text-stroke-width: 4px;
  }

  .rule .formula .flbl {
    font-size: 1.25rem;
    -webkit-text-stroke-width: 2.4px;
  }

  .demo-block {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .demo-block.reverse img {
    order: 0;
  }

  .demo-block p {
    text-align: left;
  }
}

@media (max-width: 860px) {

  .nav-links,
  .nav>.nav-actions {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav.open {
    flex-wrap: wrap;
    border-radius: 26px;
  }

  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 6px 0 4px;
  }

  .nav.open .nav-links a {
    width: 100%;
  }

  .nav.open>.nav-actions {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
  }

  .nav.open>.nav-actions .btn-go {
    width: 100%;
    justify-content: center;
  }

  .info-card {
    padding: 12px 24px;
  }

  /* 手機：日期在上、名稱在下兩行（UI D-27）。 */
  .tl-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 2px;
  }

  .tl-row .d {
    font-size: 1.02rem;
  }

  .tl-row .t {
    font-size: 1rem;
  }

  .tl-row .sep {
    display: none;
  }

  .steps-card {
    flex-wrap: wrap;
  }

  .step-col {
    flex: 1 1 45%;
    border-left: none;
    border-top: 1px solid rgba(150, 110, 60, .25);
    padding: 24px 12px;
  }

  .step-col:nth-child(-n + 2) {
    border-top: none;
  }

  .step-col:nth-child(odd) {
    border-right: 1px solid rgba(150, 110, 60, .25);
  }

  .h2.stars::before,
  .h2.stars::after {
    display: none;
  }

  .section-arrow {
    display: none;
  }

  .scroll-head .deco {
    opacity: .85;
    width: min(120px, 20vw);
  }
}

@media (max-width: 560px) {
  .banner .deco {
    display: none;
  }

  .podium-block .lantern {
    display: none;
  }

  .ingot {
    width: 110px;
    left: 2%;
  }

  .scroll-head .deco.l {
    left: -8%;
  }

  .scroll-head .deco.r {
    right: -8%;
  }
}

/* =========================================================
   MOBILE  —  bám theo bản thiết kế điện thoại
   (áp cho MỌI cỡ mobile ≤ 820px, đặt cuối để thắng cascade)
   ========================================================= */
@media (max-width: 820px) {
  .wrap {
    padding: 0 16px;
  }

  .section {
    padding: 26px 0;
  }

  .page[data-page="about"]>.hero+.section {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  /* ---- nav gọn: logo + nút menu cam ---- */
  .nav {
    gap: 10px;
    padding: 8px 12px 8px 14px;
  }

  .nav-toggle {
    display: block;
    background: #e8631e;
    color: #fff5e6;
  }

  .brand .logo {
    height: 45px;
  
  }

  /* ---- hero ---- */
  .hero {
    padding: 22px 0 10px;
  }

  .hero-sky .k1,
  .hero-sky .k2,
  .hero-sky .k3,
  .hero-sky .k4,
  .hero-sky .k5,
  .hero-sky .k6,
  .hero-sky .k7 {
    width: 120px;
  }

  .hero-sky .k8 {
    width: 84px;
  }

  /* ---- cuộn tiêu đề nhỏ lại; 主題/特別 dùng cuộn thay cho h2 ---- */
  .scroll-head {
    width: min(340px, 88%);
    margin: 0 auto 20px;
  }

  .scroll-head span {
    font-size: clamp(1.4rem, 6.4vw, 1.9rem);
    -webkit-text-stroke-width: .6px;
  }

  .scroll-head .deco {
    width: min(74px, 15vw);
  }

  .scroll-head.m-only {
    display: grid;
  }

  .h2.d-only {
    display: none;
  }

  .section-arrow {
    display: none;
  }

  /* ---- h2 ---- */
  .h2 {
    font-size: clamp(1.5rem, 6.2vw, 2rem);
    margin: 0 0 18px;
    -webkit-text-stroke-width: 2px;
  }

  .h2.stars::before,
  .h2.stars::after {
    display: none;
  }

  .lead {
    font-size: 1.2rem;
    font-weight: 700;
  }

  /* ---- huy hiệu tổ: 2 x 2 ---- */
  .groups {
    gap: 12px 16px;
    max-width: 320px;
    margin: 0 auto 8px;
  }

  .groups img {
    height: 56px;
  }

  /* ---- giải thưởng: bỏ ảnh podium + đèn lồng, danh sách thành thẻ ---- */
  .podium-block {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
  }

  .podium-block .podium,
  .podium-block .lantern {
    display: none;
  }

  .prize-list {
    width: 100%;
    max-width: 420px;
    gap: 0;
    background: rgba(255, 252, 244, .82);
    border: 2px solid #f0deb0;
    border-radius: 20px;
    padding: 12px 22px;
    box-shadow: var(--shadow-sm);
  }

  .prize-title {
    font-size: clamp(1.4rem, 6.4vw, 1.9rem);
    text-align: center;
    margin: 4px 0 8px;
  }

  .prize {
    justify-content: space-between;
    gap: 10px;
    padding: 12px 2px;
    border-bottom: 1px dashed rgba(150, 110, 60, .3);
  }

  .prize:last-child {
    border-bottom: none;
  }

  .prize:hover {
    transform: none;
  }

  .prize .medal {
    display: none;
  }

  .prize .rank {
    display: block;
  }

  .prize .amt {
    font-size: 1.9rem;
    -webkit-text-stroke-width: 10px;
  }

  .prize .amt small {
    font-size: .95rem;
    -webkit-text-stroke-width: 5px;
  }

  /* ---- 主題獎項: 3 cột, mỗi ô là KHUNG TRẮNG (như hình 1) ---- */
  .theme-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
  }

  .theme {
    background: #fff;
    border-radius: 16px;
    padding: 16px 8px 14px;
    box-shadow: 0 6px 16px rgba(120, 70, 25, .12);
  }

  .theme .theme-name {
    font-family: RocknRoll One;
    display: block;
    color: var(--red);
    font-weight: 400;
    font-size: .95rem;
    letter-spacing: .04em;
    margin-bottom: 1px;
  }

  .theme img {
    width: 100%;
    max-width: 92px;
    margin: 0 auto 10px;
  }

  .theme figcaption {
    font-family: Noto Sans HK;
    font-size: .72rem;
    line-height: 1.55;
    color: #91372A;
  }

  /* ---- 特別獎項: ẩn bản desktop, hiện 2 KHUNG (như hình 2) ---- */
  .special-row {
    display: none;
  }

  .special-mobile {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 460px;
    margin: 0 auto;
  }

  .special-mobile .sp-box {
    background: rgba(255, 251, 241, .9);
    border: 1.5px solid #E3623F;
    border-radius: 16px;
    padding: 18px 20px;
    text-align: left;
    box-shadow: var(--shadow-sm);
  }

  .special-mobile .sp-name {
    font-family: Inter;
    display: block;
    color: #91372A;
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: .04em;
    margin-bottom: 8px;
  }

  .special-mobile p {
    font-family: Inter;
    margin: 0;
    color: #612E09;
    font-size: .98rem;
    line-height: 1.85;
  }

  /* ---- 活動時程: ngày trên, mô tả dưới ---- */
  .info-card {
    border: 2px solid #612E09;
    padding: 8px 18px;
    max-width: 100%;
  }

  .tl-row {
    display: block;
    padding: 14px 2px;
    text-align: left;
  }

  .tl-row .d {
    font-family: RocknRoll One;
    font-weight: 400;
    color: #CB352B;
    display: block;
    font-size: 1.5rem;
    margin-bottom: 3px;
  }

  .tl-row .sep {
    display: none;
  }

  .tl-row .t {
    font-family: Inter;
    display: block;
    font-size: 1.2rem;
  }

  /* ---- 如何投稿: 4 CỤC TÁCH RỜI ---- */
  .steps-card {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .step-col {
    flex: 1;
    min-width: 0;
    padding: 16px 4px 14px;
    border: none;
    border-radius: 14px;
    background: #d5593b;
    box-shadow: 0 6px 14px rgba(150, 60, 25, .22);
  }

  .step-col:first-child,
  .step-col:nth-child(odd) {
    border: none;
  }

  .step-col b {
    font-size: 1.35rem;
  }

  .step-col p {
    font-size: .66rem;
    line-height: 1.35;
    word-break: break-all;
  }

  /* ---- 功能與示範: mỗi khối có nền box rõ ràng ---- */
  .demo-block {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
    max-width: 460px;
    margin: 0 auto 18px;
    background: rgba(255, 251, 241, .9);
    border: 1.5px solid #612E09;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
  }

  .demo-block img {
    display: none;
  }

  .demo-block .demo-d {
    display: none;
  }

  .demo-block .demo-m {
    display: block;
  }

  .demo-block h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .demo-block p {
    font-size: 1rem;
    line-height: 1.85;
    text-align: left;
  }

  .pill-btn {
    font-size: 1rem;
    padding: 11px 22px;
    margin: 16px auto 28px;
  }

  /* ---- 評選規則: 1 cột, mỗi khối là KHUNG ---- */
  .rules-row {
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 460px;
  }

  .rule {
    background: rgba(255, 251, 241, .9);
    border: 1.5px solid #612E09;
    border-radius: 16px;
    padding: 20px 20px 22px;
    box-shadow: var(--shadow-sm);
    text-align: left;
  }

  .rule h3 {
    font-size: 1.35rem;
    text-align: center;
  }

  /* công thức: nhãn nằm CẠNH % (không chồng lên), số cam đặc */
  .rule .formula {
    white-space: normal;
    text-align: left;
    margin: 0 0 14px;
    line-height: 1.15;
  }

  .rule .formula .fnum,
  .rule .formula .fmark {
    font-size: clamp(1.7rem, 9vw, 2.4rem);
    color: #e8631e;
    -webkit-text-stroke: 0;
    text-shadow: none;
  }

  .rule .formula .fpct {
    margin: 0;
  }

  .rule .formula .plus {
    font-size: 1.35rem;
    color: #e8631e;
    -webkit-text-stroke: 0;
    text-shadow: none;
    margin: 0 .3em;
    vertical-align: .12em;
  }

  .rule .formula .flbl {
    display: none;
  }

  .rule .formula .flbl-m {
    display: inline-block;
    vertical-align: middle;          /* thẳng hàng giữa với số — KHÔNG nghiêng / nhô */
    font-family: "Inter", "Noto Sans TC", "Klee One", sans-serif;
    font-weight: 700;
    font-size: .82rem;
    line-height: 1.25;
    color: #612E09;
    -webkit-text-stroke: 0;
    margin: 0 .1em 0 .34em;
  }

  /* 複賽日期與參與方式: BỎ box con quanh 時間/地點 */
  .rule-box {
    max-width: 100%;
    border: none;
    background: none;
    padding: 0;
    margin: 0 0 12px;
  }

  .rule-box p {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.75;
    margin: 0 0 2px;
  }
  .rule>p:not(.formula) {
    font-size: 1rem;
  }

  /* ---- Q&A: nội dung trong 1 KHUNG TRẮNG, canh trái ---- */
  .qa-text {
    font-family: Inter;
    max-width: 100%;
    text-align: left;
    background: #fff;
    border-radius: 16px;
    padding: 22px 22px 24px;
    box-shadow: 0 6px 18px rgba(120, 70, 25, .12);
  }

  .qa-text .q {
    font-weight: 800;
    color: #91372A;
    font-size: 1.35rem;
    margin: 18px 0 8px;
  }


  .qa-text .q:first-child {
    margin-top: 0;
  }

  .qa-text .q2 {
    color: #E3623F;
  }

  .qa-text p {
    font-weight: 400;
    font-size: 1rem;
    color: #612E09;
  }

  .ingot {
    display: none;
  }

  /* ---- footer canh giữa ---- */
  footer .wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
    gap: 14px;
  }

  footer .f-contact {
    color: #fff;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
  }

  /* 手機版「聯絡我們」和電話排同一行，Email 換到下一行。用 data-contact 指定，不靠子元素順序（第 167 批拿掉分隔號後，舊的 nth-child 規則誤藏了桌機的電話）。 */
  footer .f-contact > [data-contact="email"] {
    flex-basis: 100%;
  }

  /* ---- banner trang vote / winners ---- */
  .banner {
    width: min(400px, 94%);
  }

  .banner .deco {
    display: none;
  }

  /* 手機版篩選只佔兩列：搜尋＋「篩選」按鈕、目前條件＋投票規則；組別頁籤與排序收進篩選面板。 */
  .tabs,
  .vote-filter .vote-filter__sort {
    display: none;
  }

  .vote-filter {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 8px;
  }

  .vote-filter__search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .vote-filter__search .vote-filter__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .vote-filter__open,
  .vote-filter-summary {
    display: flex;
  }

  /* ---- lưới thẻ vote ---- */
  .vote-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  /* thẻ vote: 2 THẺ / 1 HÀNG */
  .vote-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: none;
    gap: 12px;
    margin: 0;
  }

  .vcard {
    border-radius: 14px;
  }

  .vcard .thumb {
    aspect-ratio: 4 / 3;
  }

  .vcard .info {
    padding: 10px 11px 12px;
  }

  .vcard .cat {
    font-size: 10px;
  }

  .vcard h3 {
    font-size: .9rem;
    margin: 3px 0 1px;
    line-height: 1.3;
    min-height: 2.6em;
    min-height: 2lh;
  }

  .vcard .author {
    margin: 0 0 8px;
    font-size: 13px;
  }

  .vcard .foot {
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .vcard .votes {
    font-size: .82rem;
  }

  .vcard .pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* 手機兩欄卡片縮短約三成（UI D-7）：縮圖改 16:10；拿掉和上方組別頁籤重複的組別字、重複的「作品已公開」標籤；
     主按鈕與文字連結間距縮小。 */
  .vcard .thumb,
  .vcard--skeleton .thumb {
    aspect-ratio: 16 / 10;
  }

  .vcard .cat,
  .vcard .foot .pill {
    display: none;
  }

  .vcard .author {
    margin-bottom: 4px;
  }

  /* 手機也貼齊底部：卡片是 flex 欄、上下外距不重疊，間距由署名的 4px 提供，和原本一樣。 */
  .vcard .foot {
    margin-top: auto;
  }

  .vcard .vote-action {
    margin-top: 8px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .vcard .detail-action {
    margin-top: 2px;
    padding: 2px 6px;
    font-size: 12.5px;
  }

  .tabs {
    max-width: 320px;
  }

  .tab {
    font-size: 12.5px;
    padding: 9px 4px;
  }

  .theme-row {
    gap: 6px;
  }

  .theme figcaption {
    font-size: .66rem;
  }

  .steps-card {
    gap: 6px;
  }

  .step-col {
    padding: 14px 3px 12px;
  }

  .step-col p {
    font-size: .62rem;
  }

  .step-col b {
    font-size: 1.2rem;
  }
}
/* =========================================================
   參賽者說明手冊 · TWO-PAGE FLIPBOOK
   ========================================================= */

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.book-modal.open {
  display: grid;
  place-items: center;
}

.book-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 14, 8, .86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: bookFade .25s ease;
}

@keyframes bookFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.book-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: bookRise .32s cubic-bezier(.2, .7, .2, 1);
}

@keyframes bookRise {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- stage / spread ---- */
.book-stage {
  perspective: 2200px;
  perspective-origin: 50% 46%;
}

.book-spread {
  position: relative;
  height: min(80vh, 52vw);
  aspect-ratio: 2014 / 1429;
  transform-style: preserve-3d;
}

soft shadow line down the spine
.book-spread::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 64px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, .16) 44%,
    rgba(0, 0, 0, .30) 50%,
    rgba(0, 0, 0, .16) 56%,
    rgba(0, 0, 0, 0) 100%);
  z-index: 40;
  pointer-events: none;
}

/* the two static paper halves behind the leaves */
.book-side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #fdf4e0;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .5);
}

.book-side.left  { left: 0;  border-radius: 6px 0 0 6px; }
.book-side.right { right: 0; border-radius: 0 6px 6px 0; }

.book-leaves {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  z-index: 10;
}

/* a leaf sits on the right half and pivots on the spine (its left edge) */
.leaf {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .85s cubic-bezier(.32, .08, .18, 1);
  will-change: transform;
}

.leaf.flipped {
  transform: rotateY(-180deg);
}

.leaf.turning {
  z-index: 100;
}

.leaf .face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fdf4e0;
  backface-visibility: hidden;
  border-radius: 0 6px 6px 0;
}

.leaf .face.back {
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
}

.leaf .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* shading while a page turns */
.leaf .face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(-90deg, rgba(0, 0, 0, .30), rgba(0, 0, 0, 0) 58%);
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}

.leaf.turning .face::after {
  opacity: 1;
}

/* invisible click zones to flip by tapping a page half */
.book-spread .flip-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 50;
  cursor: pointer;
}

.book-spread .flip-zone.prev { left: 0; }
.book-spread .flip-zone.next { right: 0; }

/* ---- navigation BELOW the book ---- */
.book-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.book-btn {
  display: inline-flex;
  align-items: center;
  gap: .12em;
  border: none;
  cursor: pointer;
  background: #e8631e;
  color: #fff5e6;
  font-family: "Klee One", "Noto Sans TC", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  padding: 10px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .32);
  transition: background .2s, transform .15s, opacity .2s;
}

/* the ‹ › glyphs sit low in their em-box — nudge them onto the optical centre */
.book-btn .ar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: .68em;
  height: 1em;
  font-size: 1.35em;
  line-height: 1;
  transform: translateY(-10px);
}

.book-btn:hover {
  background: #d5581a;
  transform: translateY(-2px);
}

.book-btn[disabled] {
  opacity: .35;
  cursor: default;
  pointer-events: none;
  transform: none;
}

.book-count {
  min-width: 78px;
  text-align: center;
  color: #f4e4c8;
  font-size: 15px;
  letter-spacing: .06em;
}

.book-count b {
  color: #fff;
  font-size: 17px;
}

/* ---- mobile: same book, sized to the screen ---- */
@media (max-width: 820px) {
  .book-shell {
    width: 100%;
    gap: 16px;
  }

  .book-stage {
    width: 100%;
    display: flex;
    justify-content: center;
    perspective: 1400px;
  }

  .book-spread {
    width: 96vw;
    height: auto;
  }

  .book-close {
    position: fixed;
    top: 14px;
    right: 14px;
  }

  .book-nav {
    gap: 12px;
  }

  .book-btn {
    padding: 9px 15px;
    font-size: 13px;
  }

  .book-count {
    min-width: 62px;
    font-size: 13.5px;
  }
}

@media (max-width: 360px) {
  .book-btn { padding: 8px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .leaf { transition: none; }
}

/* 投票區票數更新時間與失敗提示 */
.vote-updated {
  margin: 16px 0 0;
  text-align: center;
  font-size: .875rem;
  color: var(--ink-mute);
}

.vote-updated:empty {
  display: none;
}

/* ---------- UI/UX 第 1 批（2026-10-28） ---------- */
/* 開著任何 modal 視窗時背景不捲動（R5）。 */
html:has(dialog[open]:modal) {
  overflow: hidden;
}

/* 視窗右上角 ×（D-14） */
.vote-dialog {
  position: fixed;
}

.dialog-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-x:hover {
  background: rgba(0, 0, 0, .06);
}

.vote-dialog h2 {
  padding-right: 36px;
}

/* 問題代碼收在小字裡，給客服查詢（D-19） */
.vote-dialog__code {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--ink-soft);
}

.vote-dialog__code summary {
  cursor: pointer;
}

.vote-dialog__code code {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .06);
  font-size: .85rem;
}

/* 告知未勾選：按鈕灰色停用並提示（D-16） */
.consent-dialog__hint {
  margin-top: 12px !important;
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: right;
}

.consent-dialog .vote-dialog__actions button:last-child:disabled {
  background: #d9d9d9;
  border-color: #d9d9d9;
  color: #7a7a7a;
  opacity: 1;
}

/* 列表載入失敗的錯誤框（D-25） */
.vote-state--error {
  border: 1px solid #e3a59a;
  background: #fff4f1;
  color: var(--ink);
}

.vote-state__title {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
  color: #b3261e;
}

.vote-state--error p {
  margin: 0;
}

/* 搜尋中轉圈（D-12） */
.vote-filter__field {
  position: relative;
  display: block;
}

.vote-filter__spinner {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(0, 0, 0, .15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: vote-spin .7s linear infinite;
}

@keyframes vote-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vote-filter__spinner {
    animation-duration: 2s;
  }
}

/* 聯絡資訊連結（UI D-29） */
.contact-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- UI/UX 第 2 批（2026-10-29） ---------- */
/* 鍵盤焦點：2px 深色外框加白色間隔，在橘色按鈕上也看得清楚；滑鼠點擊不出現（UI D-4）。 */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid #3a2414;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

/* 組別頁籤群組不影響原本的排版（UI D-8） */
.tabs__groups {
  display: contents;
}

/* 縮圖載入失敗佔位（UI D-36） */
.thumb__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 上面的 display: grid 會蓋掉 hidden 屬性，圖片正常時佔位文字要明確藏起來。 */
.thumb__fallback[hidden] {
  display: none;
}

/* 未開放投票時卡片底部一行小字（UI D-21） */
.vote-closed-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* 我的投票：未登入說明、可點的作品（UI D-22、D-23） */
.my-votes__guest {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.my-votes__work {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* 隱私權說明小標題（UI D-33） */
.privacy-h {
  display: block;
  margin-top: 10px;
  color: var(--ink);
}

/* 個資告知：較大視窗、手機全螢幕，勾選與按鈕固定在底部（UI D-15） */
.consent-dialog {
  width: min(720px, calc(100vw - 32px));
  padding-bottom: 0;
}

.consent-dialog__text {
  max-height: none;
  overflow: visible;
}

.consent-dialog__footer {
  position: sticky;
  bottom: 0;
  margin: 16px -28px 0;
  padding: 12px 28px 20px;
  background: #fff;
  box-shadow: 0 -8px 16px rgba(0, 0, 0, .06);
}

@media (max-width: 640px) {
  .consent-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  /* 手機作品詳情：× 在圖片外的標題列右側，投票鈕固定在底部（UI D-17） */
  .work-dialog__close {
    position: sticky;
    top: 0;
    display: block;
    margin: 6px 6px 0 auto;
    background: #fff;
  }

  .work-dialog .vote-action {
    position: sticky;
    bottom: 0;
    z-index: 1;
    box-shadow: 0 -8px 16px rgba(255, 255, 255, .9);
  }
}

/* 手冊視窗的關閉鈕（UI D-34） */
.book-close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

/* 入圍與得獎名單：作品可點，手機上署名在下方（UI D-32） */
.winner-work {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

button.winner-work {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.winner-by::before {
  content: " — ";
}

@media (max-width: 640px) {
  .winner-by {
    display: block;
    font-size: 14px;
  }

  .winner-by::before {
    content: "";
  }
}

