/* ==========================================================
   深夜米食堂｜美國稻米食譜募集活動
   設計稿基準：桌機 1920px 寬，內容安全範圍 1200px
   ========================================================== */

:root {
  --purple: #110032;
  --purple-deep: #090024;
  --brown: #140e08;
  --navy: #0f325e;
  --navy-text: #03386b;
  --wine: #7c132a;
  --red: #c8302f;
  --cream: #ffffee;
  --paper: #f7f0e6;
  --gold: #ffc033;
  --yellow: #efd027;
  --highlight: #fcf5b6;
  --ink: #1d1a1a;

  --header-h: 80px;
  --container: 1200px;
  --font-tc: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-en: "DM Sans", var(--font-tc);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.9;
  letter-spacing: .08em;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
em { font-style: normal; }
mark { background: none; color: var(--wine); font-weight: 700; }
[hidden] { display: none !important; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; position: relative; }
.sp { display: none; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- 共用：暖簾標題（設計稿為特殊字型＋曲線，整張以圖片輸出） ---------- */
.noren { position: relative; width: min(750px, 92%); margin: 0 auto; }
.noren img { width: 100%; }
/* 布紋在設計稿為「覆蓋」混合：與布簾及區段背景混合後，超出布簾的部分才會變成柔和陰影 */
.noren .noren-tex { position: absolute; inset: 0; height: 100%; mix-blend-mode: overlay; pointer-events: none; }

.btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 240px; padding: 14px 40px;
  border: 2px solid var(--gold); border-radius: 999px;
  background: transparent; color: var(--gold);
  font-family: var(--font-tc); font-weight: 700; font-size: 22px; letter-spacing: .3em;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-gold:hover { background: var(--gold); color: var(--purple-deep); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  background: rgba(9, 0, 36, .92);
  backdrop-filter: blur(6px);
}
.header-inner {
  height: 100%;
  width: min(var(--container), 100% - 32px);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
}
.brand img { width: 155px; }
.site-nav { display: flex; align-items: center; gap: 36px; font-family: var(--font-tc); font-size: 17px; letter-spacing: .1em; }
.site-nav a { text-decoration: none; transition: color .2s; }
.site-nav a:hover { color: var(--gold); }
.nav-threads {
  border: 1.5px solid #e8c56a; border-radius: 999px;
  background: transparent; padding: 2px 14px; font-weight: 700;
  transition: background .2s, color .2s;
}
.nav-threads:hover { background: #e8c56a; color: var(--purple-deep); }
/* 外框漸變色循環：以 conic-gradient 旋轉角度，遮罩只留外框，按鈕內部維持透明 */
@property --glow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn-glow { position: relative; border-color: transparent !important; isolation: isolate; }
.btn-glow::before {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  padding: 2px; border-radius: inherit;
  background: conic-gradient(from var(--glow-angle), #ffc033, #fff3b0, #ff7a59, #c8302f, #ff7a59, #fff3b0, #ffc033);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: glow-spin 4s linear infinite;
  pointer-events: none;
}
@keyframes glow-spin { to { --glow-angle: 360deg; } }
.nav-toggle { display: none; }

/* ---------- 主視覺 ---------- */
.hero {
  position: relative;
  min-height: 766px;
  padding-top: calc(var(--header-h) + 120px);
  background: #110032;
  text-align: center;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
/* 窗戶燈與天際線的混合模式同設計稿（變亮） */
.hero-lights { mix-blend-mode: lighten; }
.hero-inner { position: relative; }
.hero-title { width: min(1140px, 96%); margin: 0 auto; }
.hero-title img { width: 100%; }
.hero-cta-text {
  margin-top: 24px;
  font-family: var(--font-tc); font-weight: 700;
  font-size: clamp(18px, 2.4vw, 34px);
  letter-spacing: .3em; margin-right: -.3em;
  color: #fbe9c4;
}
.hero-ornament { display: flex; align-items: center; justify-content: center; gap: 12px; width: min(840px, 90%); margin: 10px auto 0; }
.hero-ornament span { flex: 1; height: 2px; background: linear-gradient(90deg, transparent, #c9a46a); }
.hero-ornament span:last-child { transform: scaleX(-1); }
.hero-ornament i { width: 8px; height: 8px; background: #c9a46a; transform: rotate(45deg); }

/* ---------- 前言 ---------- */
.intro {
  position: relative;
  margin-top: -26px;
  padding: 110px 0 90px;
  background:
    url(../img/bg-intro-top.webp) center -2px / 1920px auto no-repeat,
    #0f3260 url(../img/bg-intro.webp) center 60px / cover no-repeat;
}
.intro-inner { display: grid; grid-template-columns: 1fr 520px; gap: 40px; align-items: center; }
.intro-text { position: relative; padding-left: 48px; font-size: 22px; line-height: 2.3; letter-spacing: .15em; }
.intro-text p + p { margin-top: 1.2em; }
.intro-text em { color: var(--highlight); }
.intro-stalk { position: absolute; left: -110px; bottom: -110px; width: 200px; opacity: .55; pointer-events: none; }
.intro-photo img { width: 100%; }

/* ---------- 期待募集 ---------- */
.recruit {
  position: relative;
  padding: 50px 0 150px;
  background:
    url(../img/bg-recruit-bottom.webp) center calc(100% + 2px) / 100% auto no-repeat,
    var(--brown) url(../img/bg-recruit.webp) center top / auto 100% no-repeat;
  text-align: center;
}
.recruit-lead {
  margin-top: 26px;
  font-family: var(--font-tc);
  font-size: 22px; letter-spacing: .2em; line-height: 2.1;
  color: var(--highlight);
}
/* 美食跑馬燈：JS 複製整組圖片填滿寬度，向左位移一組的寬度後無縫重來 */
.food-carousel { margin-top: 40px; overflow: hidden; }
.food-track {
  list-style: none;
  display: flex; gap: 26px; width: max-content;
  padding: 0 0 12px;
  animation: food-marquee var(--marquee-duration, 40s) linear infinite;
}
.food-carousel:hover .food-track { animation-play-state: paused; }
.food-track li { flex: 0 0 auto; width: 210px; }
.food-track img { width: 100%; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
@keyframes food-marquee { to { transform: translateX(calc(-1 * var(--marquee-distance, 50%))); } }
@media (prefers-reduced-motion: reduce) {
  .food-carousel { overflow-x: auto; }
}

/* ---------- 活動詳情 ---------- */
.details {
  position: relative;
  padding: 40px 0 180px;
  background:
    url(../img/bg-details-bottom.webp) center calc(100% + 2px) / 100% auto no-repeat,
    var(--purple);
  isolation: isolate;
  overflow-x: clip;  /* 1920px 寬的月亮層不造成橫向捲動；垂直不裁切，月亮可以超出區段上緣 */
}
/* 城市獨立一層（不再是背景圖），月亮才能躲在建築物後面 */
.details-sky { position: absolute; inset: 0 0 auto; height: 832px; overflow: hidden; z-index: 1; pointer-events: none; }
/* city.svg 從設計稿 y=2105 開始，本區段從 y=2223 開始，所以往上移 118px */
.details-sky img { position: absolute; top: -118px; left: 50%; width: 1920px; max-width: none; transform: translateX(-50%); }
.details > .container { position: relative; z-index: 2; }
/* 月亮層：與 city.svg 同座標（設計稿 1920 寬、從 y=2105 起），往上多留 40px 給月亮的最終位置。
   遮罩 = 全區 減去 建築剪影（city-mask.png），所以月亮經過建築時會被完全擋住 */
.moon-layer {
  position: absolute; top: -158px; left: 50%; width: 1920px; height: 990px; transform: translateX(-50%);
  z-index: 0; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0), url(../img/city-mask.png) 0 40px / 1920px 950px no-repeat;
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0), url(../img/city-mask.png) 0 40px / 1920px 950px no-repeat;
          mask-composite: exclude;
}
/* 設計稿月亮位置：x=1347、y=2096（比 city 頂端高 9px） */
.moon {
  position: absolute; left: 1347px; top: 31px; width: 131px;
  transition: transform 3s cubic-bezier(.16, .8, .24, 1);
}
/* 有 JS 時先藏在建築物後方（<head> 內加上 .js，首次繪製前就生效），進入畫面後加上 moon-risen 即升起 */
.js .details:not(.moon-risen) .moon { transform: translateY(700px); }  /* 此深度月亮整個寬度都被建築擋住 */
@media (prefers-reduced-motion: reduce) { .js .details .moon { transform: none; opacity: 1; } }

.tabs { display: flex; justify-content: center; gap: 62px; margin: 46px auto 56px; }
.tabs button {
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-tc); font-weight: 700; font-size: 22px; letter-spacing: .05em;
  color: #fff;
  transition: transform .2s;
}
/* 選取中的頁籤 icon 為黃色、其餘為米白（設計稿兩種狀態各輸出一張，疊在一起切換） */
.tab-icon { position: relative; display: block; width: 135px; transition: transform .2s; }
.tab-icon img { width: 100%; }
.tab-icon .on { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
.tabs button:hover .tab-icon { transform: translateY(-4px); }
.tabs button[aria-selected="true"] .tab-icon .on { opacity: 1; }

.board {
  width: min(912px, 100%);
  margin: 0 auto;
  padding: 44px 64px 64px;
  border-radius: 50px;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(15, 50, 94, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 50, 94, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.board-title {
  display: flex; justify-content: center; align-items: center; gap: 22px;
  margin-bottom: 36px;
  font-family: var(--font-tc); font-weight: 700; font-size: 24px; letter-spacing: .3em;
  color: var(--navy);
}
.board-title::before, .board-title::after { content: ""; width: 2px; height: 26px; background: var(--navy); }
.panel { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 活動時程 */
.schedule { width: min(640px, 100%); margin: 0 auto; }
.schedule > div { display: flex; align-items: center; gap: 36px; padding: 26px 0; }
.schedule > div + div { border-top: 3px solid rgba(0, 0, 0, .1); }
.schedule dt, .pill {
  flex: 0 0 auto;
  display: inline-block;
  padding: 6px 22px;
  border: 1.5px solid var(--wine); border-radius: 999px;
  color: var(--wine);
  font-family: var(--font-tc); font-weight: 700; font-size: 20px; letter-spacing: .25em;
  line-height: 1.6;
}
.schedule dt { min-width: 200px; text-align: center; }
.schedule dd { font-size: 20px; line-height: 1.6; letter-spacing: .1em; }

/* 活動規則 */
.rules { list-style: none; counter-reset: r; font-size: 18px; line-height: 1.9; }
.rules li { counter-increment: r; padding-left: 2em; text-indent: -2em; }
.rules li::before { content: counter(r) "."; display: inline-block; width: 2em; text-indent: 0; }
.rules li + li { margin-top: .7em; }
.rules a { color: var(--wine); font-weight: 700; }

/* 評選標準 */
.criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 36px; }
.criteria article {
  position: relative;
  min-height: 253px;
  padding: 50px 30px 30px;
  background: center / 100% 100% no-repeat;
  text-align: center;
  color: #fff;
}
.criteria .tag {
  position: absolute; left: 9%; top: 0;
  font-family: var(--font-tc); font-size: 13px; letter-spacing: .1em; line-height: 30px;
}
.criteria h4 {
  font-family: var(--font-tc); font-weight: 700; font-size: 24px; letter-spacing: .1em;
  color: var(--yellow);
  padding-bottom: 12px; margin-bottom: 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent) center bottom / 70% 1px no-repeat;
}
.criteria h4 b { font-family: var(--font-en); }
.criteria p { font-size: 15px; line-height: 1.95; }

/* 活動獎項 */
.prizes section + section { margin-top: 30px; padding-top: 30px; border-top: 3px solid rgba(0, 0, 0, .1); }
.prizes header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 30px; margin-bottom: 16px; }
.prizes header strong { color: var(--wine); font-size: 20px; letter-spacing: .15em; }
.prizes .pill { position: relative; }
.ribbon {
  position: absolute; left: 0; top: -24px;
  padding: 0 10px; background: var(--wine); color: #fff;
  font-style: normal; font-size: 14px; letter-spacing: .05em; line-height: 24px;
  transform: rotate(-3deg);
}
.prizes dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 0; padding-left: 20px; font-size: 18px; line-height: 1.8; }
.prizes dt { color: var(--navy); font-weight: 700; }
.prizes dt::after { content: "："; }

/* 投稿流程 */
.stage { display: inline-flex; margin: 0 0 18px; border: 1.5px solid var(--wine); border-radius: 999px; overflow: hidden; font-family: var(--font-tc); font-size: 22px; letter-spacing: .25em; }
.stage span { padding: 6px 22px; color: var(--wine); }
.stage b { padding: 6px 26px; background: var(--wine); color: #fff; border-radius: 999px 0 0 999px; }
.stage em { color: var(--yellow); }
.flow ol { list-style: none; counter-reset: f; padding-left: 20px; font-size: 19px; line-height: 1.9; }
.flow li { counter-increment: f; padding-left: 1.6em; text-indent: -1.6em; }
.flow li::before { content: counter(f) "."; display: inline-block; width: 1.6em; text-indent: 0; }
.flow li + li { margin-top: .5em; }
.flow li strong { color: var(--wine); }
.flow-shot { margin: 26px 0 40px; padding: 10px; background: #fff; border-radius: 6px; }
.flow-shot img { width: 100%; }
.text-link { padding: 0; border: 0; background: none; color: var(--wine); font-weight: 700; text-decoration: underline; text-indent: 0; }

/* ---------- 產品介紹 ---------- */
.products { padding: 20px 0 140px; background: var(--brown); }
.rice-list { width: min(var(--container), 100%); margin: 60px auto 0; display: grid; gap: 70px; }
.rice { position: relative; display: grid; grid-template-columns: 35% 1fr; min-height: 259px; }
/* 米圖畫布固定 590×335（設計稿單位）：照片 420px 佔 35% 欄寬，其餘是碗的外溢；寬度 = 35% × 590 / 420 */
.rice-img { position: absolute; left: 0; top: 0; width: 49.17%; z-index: 1; pointer-events: none; }
.rice-body {
  grid-column: 2;
  position: relative;
  padding: 26px 70px 26px 70px;
  background: #271e1a url(../img/panel.webp) center / cover;
  overflow: hidden;
}
/* 背景大字「短粒／中粒／長粒」：設計稿 104px、行距 125px、#F7E7D7 30% 覆蓋，超出底板邊緣被切掉 */
.rice-body::before {
  content: attr(data-grain);
  position: absolute; right: -20px; top: 15px;
  writing-mode: vertical-rl;
  white-space: nowrap;
  font-family: var(--font-tc); font-weight: 700; font-size: 104px; line-height: 1; letter-spacing: 21px;
  color: #f7e7d7; opacity: .3; mix-blend-mode: overlay;
  pointer-events: none;
}
.rice-body > * { position: relative; }
.rice-body h3 { font-family: var(--font-tc); font-weight: 700; font-size: 28px; letter-spacing: .2em; color: #f7e7d7; margin-bottom: 8px; }
.rice-body p { font-size: 17px; line-height: 2; letter-spacing: .12em; color: #f1ece6; }
.rice-body .pair { color: var(--yellow); font-weight: 700; }
.rice:not(.rice--rev) .rice-body { padding-left: 70px; }
.rice--rev { grid-template-columns: 1fr 35%; }
.rice--rev .rice-img { left: auto; right: 0; }
.rice--rev .rice-body { grid-column: 1; grid-row: 1; padding-left: 40px; padding-right: 110px; }
.rice--rev .rice-body::before { right: auto; left: -10px; }

/* ---------- 主廚精選食譜 ---------- */
/* 區段上下緣的波浪／弧形圖以寬度 100% 縮放，高度常是小數，邊緣一列會半透明而透出底色（細線）；
   因此都往區段外多推 2px，讓半透明的那一列落在區段外被裁掉 */
.chef {
  position: relative;
  padding: 140px 0 150px;
  background:
    url(../img/bg-red-top.webp) center -2px / 100% auto no-repeat,
    url(../img/bg-red-bottom.webp) center calc(100% + 2px) / 100% auto no-repeat,
    #871530 url(../img/bg-red.webp) center / cover;
  text-align: center;
}
.chef-lead { margin-top: 24px; font-size: 19px; letter-spacing: .15em; line-height: 2; }
.recipes { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: min(980px, 100%); margin: 44px auto 0; text-align: left; }
.recipes a { display: block; height: 100%; background: #f4f4f4; border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s; }
.recipes a:hover { transform: translateY(-6px); box-shadow: 0 14px 28px rgba(0, 0, 0, .3); }
.recipes img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.recipes h3 { padding: 14px 16px 2px; font-family: var(--font-tc); font-weight: 700; font-size: 18px; letter-spacing: .05em; line-height: 1.5; }
.recipes p { padding: 0 16px 16px; font-size: 13px; color: #666; }

/* ---------- 好味大串連 ---------- */
.threads {
  padding: 100px 0 140px;
  background: var(--purple) url(../img/city.svg) center -138px / 1920px auto no-repeat;  /* 同一組城市，本區段從 y=5832 開始 */
  text-align: center;
}
.threads-lead { margin-top: 24px; font-size: 19px; letter-spacing: .15em; color: var(--highlight); }
.threads-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; align-items: start; text-align: left; }
.threads-grid .text-post-media { margin: 0 !important; min-width: 0 !important; max-width: 100% !important; }
.threads-cell { position: relative; min-width: 0; }
/* embed.js 會保留原 blockquote，且依它是否在畫面內才載入 iframe，所以只能視覺隱藏，不能 display:none */
.threads-cell .text-post-media-registered {
  position: absolute !important; left: 0; top: 0;
  width: 1px !important; min-width: 0 !important; height: 1px; padding: 0 !important; border: 0 !important;
  overflow: hidden; clip-path: inset(50%); opacity: 0;
}
.threads-card { background: #fff; border-radius: 16px; padding: 0; overflow: hidden; min-height: 200px; }
.threads-empty { margin-top: 40px; color: rgba(255, 255, 255, .7); }
.threads-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 50px; }
.btn-more { padding: 12px 36px; border: 1.5px solid rgba(255, 255, 255, .6); border-radius: 999px; background: none; font-size: 18px; letter-spacing: .2em; }
.btn-more:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Footer：活動注意事項 ---------- */
.site-footer { padding: 70px 0 40px; background: var(--purple-deep); border-top: 4px solid var(--wine); }
.notice h2 { font-family: var(--font-tc); font-size: 24px; letter-spacing: .25em; color: var(--gold); margin-bottom: 20px; }
.notice-body { position: relative; max-height: 230px; overflow: hidden; transition: max-height .5s ease; }
.notice-body::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(transparent, var(--purple-deep)); transition: opacity .3s; }
.notice.is-open .notice-body { max-height: 3000px; }
.notice.is-open .notice-body::after { opacity: 0; }
.notice ol { padding-left: 1.6em; font-size: 15px; line-height: 1.9; color: rgba(255, 255, 255, .82); }
.notice li + li { margin-top: .3em; }
.notice-toggle { display: block; margin: 18px auto 0; padding: 8px 40px; border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 999px; background: none; font-size: 15px; letter-spacing: .2em; }
.notice-toggle:hover { border-color: var(--gold); color: var(--gold); }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 40px; margin-top: 60px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, .15); font-family: var(--font-tc); font-size: 16px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--gold); }
.footer-nav .brand { margin-right: auto; }
.copyright { margin-top: 30px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .45); }

/* ---------- 浮動 CTA ---------- */
.float-cta {
  position: fixed; right: 32px; bottom: 32px; z-index: 40;
  width: 128px; height: 128px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  /* 原本的 hover 樣式（金色漸層＋深藍字）改為預設，讓按鈕更明顯 */
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #ffe27a, var(--gold) 60%, #e89a10);
  font-family: var(--font-tc); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: .1em;
  text-decoration: none; color: #032035;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: transform .25s cubic-bezier(.2, .8, .3, 1.2), box-shadow .25s, opacity .2s;
}
.float-cta.is-hidden { opacity: 0; transform: scale(.8); pointer-events: none; }
.float-cta:hover, .float-cta:focus-visible { transform: scale(1.15); box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 192, 51, .45); }

/* ---------- 彈窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; overflow-y: auto; padding: 40px 16px; }
.modal-backdrop {
  position: fixed; inset: 0;
  background-color: rgba(26, 11, 63, .96);
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.modal-dialog { position: relative; width: min(860px, 100%); padding-top: 30px; animation: pop .3s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; right: -6px; top: -20px; z-index: 3; width: 48px; height: 48px; border: 0; background: none; color: #fff; font-size: 44px; line-height: 1; }
.modal-title { position: relative; z-index: 2; width: 100%; margin-bottom: -60px; }
.modal-paper { position: relative; padding: 90px 7% 50px; background: var(--paper); color: var(--ink); box-shadow: 14px 14px 0 rgba(150, 140, 135, .9); }
.modal-tip { width: min(330px, 70%); margin: 0 auto 18px; }
.modal-intro { text-align: center; padding-bottom: 14px; border-bottom: 1.5px solid #aaa; font-size: 19px; letter-spacing: .1em; }
.modal-intro em, .modal-steps em { color: var(--wine); font-weight: 700; }
.modal-steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px 18px; margin-top: 44px; }
.modal-steps li {
  counter-increment: s;
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 34px 20px 24px;
  border-radius: 22px; background: #e8d2d0;
  box-shadow: 0 6px 10px rgba(0, 0, 0, .08);
}
.modal-steps li.wide { grid-column: 1 / -1; padding-left: 40px; }
.modal-steps li::before {
  content: counter(s);
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wine); color: #fff; font-weight: 700; font-size: 26px;
}
.modal-steps li.wide::before { left: 22%; }
.modal-steps img { flex: 0 0 auto; width: 84px; }
.modal-steps li.wide img { width: 120px; }
.modal-steps h3 {
  display: inline-block; margin-bottom: 8px; padding: 0 16px;
  background: #111; color: var(--yellow);
  font-family: var(--font-tc); font-size: 18px; letter-spacing: .2em; line-height: 34px;
  clip-path: polygon(2% 8%, 98% 0, 100% 92%, 0 100%);
}
.modal-steps p { font-size: 15px; line-height: 1.85; }
.threads-form { display: grid; gap: 18px; margin-top: 40px; }
.threads-form label { display: grid; gap: 6px; font-weight: 700; font-size: 16px; color: var(--navy); }
.threads-form input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid #b9aaa0; border-radius: 10px; background: #fff;
  font: inherit; font-weight: 500; font-size: 16px; letter-spacing: .02em; color: var(--ink);
}
.threads-form input:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(124, 19, 42, .15); }
.threads-form input[aria-invalid="true"] { border-color: var(--red); }
.form-msg { min-height: 1.6em; text-align: center; font-size: 15px; font-weight: 700; }
.form-msg.is-error { color: var(--red); }
.form-msg.is-ok { color: #1c7a3a; }
/* 送出按鈕：白底之外的金色外框膠囊；hover 時右側長出長箭頭（設計稿 270px → 447px） */
.btn-submit {
  display: flex; align-items: center; justify-content: center;
  min-width: 216px; height: 60px; margin: 56px auto 0; padding: 0 44px;
  border: 2px solid var(--gold); border-radius: 999px;
  background: transparent; color: var(--gold);
  font-family: var(--font-tc); font-weight: 700; font-size: 28px; letter-spacing: .3em; line-height: 1;
}
.btn-submit span { margin-right: -.3em; }
.btn-arrow {
  position: relative; display: block;
  width: 0; height: 2px; margin-left: 0;
  background: currentColor; opacity: 0;
  transition: width .35s ease, margin-left .35s ease, opacity .2s ease;
}
.btn-arrow::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 14px; height: 14px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg); transform-origin: center;
}
.btn-submit:hover .btn-arrow, .btn-submit:focus-visible .btn-arrow { width: 86px; margin-left: 24px; opacity: 1; }
.btn-submit[disabled] { opacity: .6; cursor: wait; }
.btn-submit[disabled] .btn-arrow { width: 0; margin-left: 0; opacity: 0; }
body.modal-open { overflow: hidden; }

/* ==========================================================
   平板
   ========================================================== */
@media (max-width: 1100px) {
  .site-nav { gap: 22px; font-size: 15px; }
  .intro-inner { grid-template-columns: 1fr 42%; }
  .intro-text { font-size: 19px; padding-left: 0; }
  .tabs { gap: 3vw; }
  .tab-icon { width: 110px; }
  .rice-body { padding-left: 50px !important; }
}

/* ==========================================================
   手機
   ========================================================== */
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .pc { display: none; }
  .sp { display: inline; }

  /* header */
  .brand img { width: 120px; }
  .nav-toggle {
    display: grid; gap: 5px; align-content: center;
    width: 44px; height: 44px; margin-right: -8px; padding: 10px;
    border: 0; background: none;
  }
  .nav-toggle span { display: block; height: 2px; background: #fff; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto;
    flex-direction: column; gap: 0;
    padding: 8px 24px 24px;
    background: rgba(9, 0, 36, .98);
    font-size: 17px;
    transform: translateY(-110%); visibility: hidden;
    transition: transform .3s, visibility .3s;
  }
  .site-nav.is-open { transform: none; visibility: visible; }
  .site-nav a, .site-nav .nav-threads { width: 100%; padding: 14px 0; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .site-nav .nav-threads { order: 9; margin-top: 16px; border: 1.5px solid #e8c56a; padding: 10px; }

  /* hero */
  .hero { min-height: 0; padding: calc(var(--header-h) + 70px) 0 120px; }
  .hero-cta-text { margin-top: 18px; letter-spacing: .15em; margin-right: -.15em; font-size: 17px; }

  /* intro */
  .intro { padding: 80px 0 70px; background-size: 1000px auto, cover; }
  .intro-inner { grid-template-columns: 1fr; gap: 30px; }
  .intro-text { font-size: 17px; line-height: 2.1; letter-spacing: .1em; }
  .intro-stalk { display: none; }
  .intro-photo { width: 88%; margin: 0 auto; }

  /* recruit */
  .recruit { padding: 40px 0 80px; background-size: 100% auto, auto 100%; }
  .recruit-lead { font-size: 15.5px; letter-spacing: .06em; padding-inline: 8px; }
  .noren { width: min(420px, 100%); }
  .food-track { gap: 16px; }
  .food-track li { width: 44vw; max-width: 220px; }

  /* details */
  .details { padding: 30px 0 110px; }
  .details-sky { height: 480px; }
  .details-sky img { top: -68px; width: 1100px; }
  /* 手機的城市縮小、月亮改放右側，剪影對不上，改成單純升起＋淡入 */
  .moon-layer { inset: -60px 0 auto auto; left: auto; width: 100%; height: 160px; transform: none; -webkit-mask: none; mask: none; }
  .moon { left: auto; right: 20px; top: 0; width: 70px; transition: transform 2s cubic-bezier(.2, .7, .2, 1), opacity 1.2s ease; }
  .js .details:not(.moon-risen) .moon { transform: translateY(120px); opacity: 0; }
  .tabs { gap: 0; justify-content: space-between; margin: 30px -6px 30px; }
  .tabs button { flex: 1; font-size: 13px; gap: 6px; letter-spacing: 0; }
  .tab-icon { width: min(60px, 15vw); }
  .board { padding: 30px 18px 36px; border-radius: 28px; background-size: 32px 32px; }
  .board-title { font-size: 20px; margin-bottom: 24px; }
  .schedule > div { flex-direction: column; gap: 10px; padding: 20px 0; text-align: center; }
  .schedule dt { min-width: 0; font-size: 17px; }
  .schedule dd { font-size: 17px; }
  .rules { font-size: 15.5px; line-height: 1.85; }
  .criteria { grid-template-columns: 1fr; gap: 22px; }
  .criteria article { min-height: 0; padding: 46px 22px 26px; }
  .criteria h4 { font-size: 21px; }
  .criteria p { font-size: 14.5px; }
  .pill { font-size: 16px; padding: 4px 16px; letter-spacing: .15em; }
  .prizes header strong { font-size: 17px; }
  .prizes dl { grid-template-columns: 1fr; padding-left: 0; font-size: 15.5px; gap: 0; }
  .prizes dd { margin-bottom: 8px; }
  .stage { font-size: 16px; letter-spacing: .1em; }
  .stage span, .stage b { padding: 5px 14px; }
  .flow ol { padding-left: 0; font-size: 15.5px; }
  .flow-shot { padding: 4px; }

  /* products */
  .products { padding: 10px 0 90px; }
  .rice-list { margin-top: 36px; gap: 40px; }
  .rice, .rice--rev { display: block; min-height: 0; }
  .rice-img, .rice--rev .rice-img { position: relative; width: 100%; margin: 0 0 -40px; }
  .rice-body, .rice--rev .rice-body { padding: 56px 24px 26px !important; }
  .rice-body::before { font-size: 80px; letter-spacing: 16px; }
  .rice-body h3 { font-size: 22px; }
  .rice-body p { font-size: 15px; line-height: 1.9; letter-spacing: .06em; }

  /* chef */
  .chef { padding: 80px 0 90px; }
  .chef-lead { font-size: 15.5px; letter-spacing: .06em; }
  .recipes { grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
  .recipes h3 { padding: 10px 12px 0; font-size: 15px; }
  .recipes p { padding: 0 12px 12px; font-size: 12px; }

  /* threads */
  .threads { padding: 70px 0 90px; background-size: 1200px auto; background-position: center -86px; }
  .threads-lead { font-size: 15.5px; letter-spacing: .06em; }
  .threads-grid { grid-template-columns: 1fr; }
  .btn-gold { min-width: 0; width: 100%; max-width: 320px; font-size: 18px; letter-spacing: .12em; padding: 12px 20px; }

  /* footer */
  .site-footer { padding: 50px 0 110px; }
  .notice h2 { font-size: 20px; }
  .notice ol { font-size: 14px; }
  .footer-nav { gap: 12px 22px; font-size: 14px; }
  .footer-nav .brand { width: 100%; margin: 0 0 8px; display: flex; justify-content: center; }

  /* float cta */
  .float-cta { right: 14px; bottom: 14px; width: 76px; height: 76px; font-size: 18px; border-width: 2px; }

  /* modal */
  .modal { padding: 24px 12px; }
  .modal-close { right: 0; top: -14px; font-size: 38px; }
  .modal-title { margin-bottom: -30px; }
  .modal-paper { padding: 50px 18px 30px; box-shadow: 8px 8px 0 rgba(150, 140, 135, .9); }
  .btn-submit { min-width: 180px; height: 52px; margin-top: 36px; padding: 0 32px; font-size: 22px; }
  .btn-submit:hover .btn-arrow, .btn-submit:focus-visible .btn-arrow { width: 56px; margin-left: 16px; }
  .modal-intro { font-size: 15px; letter-spacing: .04em; }
  .modal-steps { grid-template-columns: 1fr; gap: 34px; margin-top: 36px; }
  .modal-steps li, .modal-steps li.wide { padding: 32px 16px 18px; gap: 12px; }
  .modal-steps li.wide::before { left: 50%; }
  .modal-steps img { width: 64px; }
  .modal-steps li.wide img { width: 80px; }
  .modal-steps h3 { font-size: 16px; }
  .modal-steps p { font-size: 14px; }
}

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

/* 評選標準卡片底圖 */
.criteria article:nth-child(1) { background-image: url(../img/card0.webp); }
.criteria article:nth-child(2) { background-image: url(../img/card1.webp); }
.criteria article:nth-child(3) { background-image: url(../img/card2.webp); }
.criteria article:nth-child(4) { background-image: url(../img/card3.webp); }

/* 提示訊息 */
.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 28px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); color: var(--purple-deep);
  font-weight: 700; font-size: 16px; letter-spacing: .08em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
