/* 蠟哩蠟塌 La.Li.La.Ta — 聖誕市集展示頁
   視覺規格沿用正式網站（reference/DESIGN.md）：型錄紙、2px 墨框、零模糊位移陰影、零圓角。
   唯一斷點：max-width: 767px。 */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  /* 只含拉丁字母、數字與常用標點（約 11 KB）。中文一律落到下方的中文字型。 */
  unicode-range: U+0020-007E, U+00B7, U+2014, U+2019;
}

:root {
  --cs-stock: #f6ecd7;
  --cs-ink: #1a1a17;
  --cs-green: #2f6b57;
  --cs-gold: #e8b13c;
  --cs-coral: #e58f74;
  --cs-white: #ffffff;
  --cs-ink-mid: rgba(26, 26, 23, 0.74);
  --cs-ink-soft: rgba(26, 26, 23, 0.66);
  --cs-rule-inner: rgba(26, 26, 23, 0.18);
  --cs-cream-soft: rgba(246, 236, 215, 0.95);

  --cs-bw: 2px;
  --cs-sh-lg: 5px 5px 0 var(--cs-ink);
  --cs-sh-md: 4px 4px 0 var(--cs-ink);
  --cs-sh-sm: 3px 3px 0 var(--cs-ink);
  --cs-sh-xs: 2px 2px 0 var(--cs-ink);
  --cs-px: 30px;
  --cs-ease: 0.12s ease-out;

  /* 不載入任何中文網路字型：iPhone 用內建 PingFang TC，其他裝置用系統的 Noto。 */
  --cs-display: "Fraunces", "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", serif;
  --cs-body: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
  /* 英文段落用：拉丁字型在前。中文字型的 ’ — 是全形，排在前面會把 she’s 拉開成 she’ s */
  --cs-body-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", sans-serif;
  --cs-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-data: 11px;
  --fs-micro: 12px;
  --fs-small: 13px;
  --fs-body: 15px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--cs-stock);
  color: var(--cs-ink);
  font-family: var(--cs-body);
  font-size: var(--fs-body);
  line-height: 1.9;
}

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

a {
  color: var(--cs-green);
  text-underline-offset: 3px;
}

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

.mono {
  font-family: var(--cs-mono);
  font-variant-numeric: tabular-nums;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--cs-px);
}

[hidden] {
  display: none !important;
}

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

/* ── 公告列 ─────────────────────────────── */
.announce {
  background: var(--cs-green);
  color: var(--cs-stock);
  border-bottom: var(--cs-bw) solid var(--cs-ink);
  text-align: center;
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
  padding: 9px var(--cs-px);
}

/* ── 頁首 ───────────────────────────────── */
.masthead {
  border-bottom: var(--cs-bw) solid var(--cs-ink);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand-plate {
  flex: none;
  width: 56px;
  height: 56px;
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-sm);
  background: var(--cs-white);
}

.brand-plate img {
  width: 100%;
  height: 100%;
}

.wordmark {
  margin: 0;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.wordmark small {
  display: block;
  margin-top: 6px;
  font-family: var(--cs-body);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cs-ink-soft);
}

/* ── 範例內容提示 ───────────────────────── */
.sample-notice {
  margin: 22px 0 0;
  padding: 12px 16px;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-xs);
  font-size: var(--fs-small);
  line-height: 1.7;
}

.sample-notice strong {
  margin-right: 6px;
}

/* ── 開場 ───────────────────────────────── */
.hero {
  padding: 34px 0 10px;
}

.hero-sheet {
  position: relative;
  padding: 30px 30px 26px;
  background-color: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-lg);
}

.hero-sheet::before {
  /* 網點：印刷網屏，系統唯一的材質 */
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 38%;
  height: 100%;
  background-image: radial-gradient(var(--cs-ink) 1.4px, transparent 1.5px);
  background-size: 11px 11px;
  opacity: 0.12;
  pointer-events: none;
}

.hero h1 {
  position: relative;
  margin: 0 0 12px;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  word-break: keep-all;
}

.hero .lede {
  position: relative;
  margin: 0;
  max-width: 34em;
  color: var(--cs-ink-mid);
  line-height: 1.95;
}

.booth {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 12px;
  border: var(--cs-bw) solid var(--cs-ink);
  background: var(--cs-stock);
  font-weight: 700;
  font-size: var(--fs-small);
}

/* ── 區段標題：標題＋延伸的墨線 ─────────── */
.section {
  padding: 44px 0 12px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

.section-head::after {
  content: "";
  flex: 1;
  height: var(--cs-bw);
  background: var(--cs-ink);
}

.section-head .count {
  order: 2;
  font-size: var(--fs-micro);
  color: var(--cs-ink-soft);
  white-space: nowrap;
}

.section-head .count .mono {
  font-size: var(--fs-data);
}

.section-head::after {
  order: 1;
}

/* ── 目錄索引 ───────────────────────────── */
.index-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-sm);
  color: var(--cs-ink);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: transform var(--cs-ease), box-shadow var(--cs-ease);
}

.index-list .mono {
  flex: none;
  font-size: var(--fs-data);
  font-weight: 400;
  color: var(--cs-ink-soft);
}

/* ── 作品圖板 ───────────────────────────── */
.catalogue {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.item {
  display: flex;
  flex-direction: column;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-md);
  scroll-margin-top: 16px;
}

.plate {
  position: relative;
  aspect-ratio: 4 / 5;
  border-bottom: var(--cs-bw) solid var(--cs-ink);
  background: var(--cs-white);
  overflow: hidden;
}

.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plate-drawing {
  /* 沒有實拍時的線稿圖板：型錄紙＋網點＋墨線，一看就知道不是照片 */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: var(--cs-stock);
  background-image: radial-gradient(rgba(26, 26, 23, 0.16) 1.4px, transparent 1.5px);
  background-size: 11px 11px;
}

.plate-drawing svg {
  width: 34%;
  height: auto;
}

.cat-no {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 8px;
  background: var(--cs-stock);
  border: var(--cs-bw) solid var(--cs-ink);
  font-family: var(--cs-mono);
  font-size: var(--fs-data);
  line-height: 1;
  transition: background-color var(--cs-ease);
}

/* 客人從分享連結或攤位指定的那一件：編號變成黃銅金（＝「你現在在這件」的狀態） */
.item.is-target .cat-no {
  background: var(--cs-gold);
  box-shadow: var(--cs-sh-xs);
}

.sticker {
  position: absolute;
  top: 14px;
  right: 12px;
  padding: 6px 12px;
  background: var(--cs-coral);
  border: var(--cs-bw) solid var(--cs-ink);
  color: var(--cs-ink);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  transform: rotate(-4deg);
}

.sticker + .sticker {
  top: 50px;
  transform: rotate(3deg);
}

.badges {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 5px 9px;
  background: var(--cs-stock);
  border: var(--cs-bw) solid var(--cs-ink);
  color: var(--cs-ink-soft);
  font-size: var(--fs-micro);
  line-height: 1.3;
}

.sticker-soldout,
.sticker + .sticker.sticker-soldout {
  top: auto;
  bottom: 16px;
  right: 14px;
  transform: rotate(-6deg);
}

.item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 20px 22px;
}

.item-name {
  margin: 0;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.3;
  word-break: keep-all;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 8px 0 0;
  color: var(--cs-ink-soft);
  font-size: var(--fs-small);
}

.price {
  color: var(--cs-ink);
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 20px;
}

.price .cur {
  margin-right: 4px;
  font-family: var(--cs-mono);
  font-weight: 400;
  font-size: var(--fs-data);
  color: var(--cs-ink-soft);
}

.meta .mono {
  font-size: var(--fs-small);
  color: var(--cs-ink);
}

.story {
  margin: 14px 0 0;
  color: var(--cs-ink-mid);
}

.story p,
.story-en p {
  margin: 0 0 0.6em;
  white-space: pre-line;
}

.story-en p:not(.story-en-title) {
  font-family: var(--cs-body-latin);
}

.story-en {
  margin: 4px 0 0;
  border-top: var(--cs-bw) solid var(--cs-rule-inner);
  color: var(--cs-ink-mid);
  line-height: 1.75;
}

.story-en summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--cs-green);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.story-en summary::-webkit-details-marker {
  display: none;
}

.story-en summary::after {
  content: "+";
  font-family: var(--cs-mono);
  font-size: 16px;
  line-height: 1;
}

.story-en[open] summary::after {
  content: "−";
}

.story-en-title {
  color: var(--cs-ink);
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 10px 0 0;
  font-size: var(--fs-small);
  line-height: 1.6;
}

.details dt,
.details dd {
  margin: 0;
  padding: 8px 0;
  border-top: var(--cs-bw) solid var(--cs-rule-inner);
}

.details dt {
  padding-right: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.details dd {
  color: var(--cs-ink-mid);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

/* ── 按鈕：按得下去 ─────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  background: var(--cs-stock);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-sm);
  color: var(--cs-ink);
  font: 700 14px/1.3 var(--cs-body);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--cs-ease), box-shadow var(--cs-ease), background-color var(--cs-ease);
}

.btn-go {
  background: var(--cs-green);
  color: var(--cs-stock);
}

.btn:active,
.index-list a:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--cs-ink);
}

@media (hover: hover) {
  .btn:hover,
  .index-list a:hover {
    transform: translate(1px, 1px);
    box-shadow: var(--cs-sh-xs);
  }

  .btn:active,
  .index-list a:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--cs-ink);
  }
}

/* 分享後的回饋：狀態用黃銅金小標，不讓按鈕變金色 */
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  background: var(--cs-gold);
  border: var(--cs-bw) solid var(--cs-ink);
  font-size: var(--fs-micro);
  font-weight: 700;
}

/* 分享和複製都被拒絕時：直接顯示連結給人長按複製 */
.share-url {
  margin-top: 12px;
}

.share-url label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.share-url input {
  width: 100%;
  min-height: 44px;
  padding: 12px 13px;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  border-radius: 0;
  color: var(--cs-ink);
  font: 400 14px/1.4 var(--cs-mono);
  -webkit-appearance: none;
  appearance: none;
}

/* ── 看完之後 ───────────────────────────── */
.next-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  box-shadow: var(--cs-sh-md);
}

.step-no {
  font-family: var(--cs-mono);
  font-size: var(--fs-data);
  color: var(--cs-ink-soft);
}

.step h3 {
  margin: 6px 0 6px;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
}

.step p {
  margin: 0 0 16px;
  color: var(--cs-ink-mid);
  font-size: 14px;
  line-height: 1.85;
}

.step .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ── 頁尾 ───────────────────────────────── */
.footer {
  margin-top: 44px;
  border-top: var(--cs-bw) solid var(--cs-ink);
  padding: 22px 0 30px;
  font-size: var(--fs-micro);
  color: var(--cs-ink-soft);
  line-height: 1.8;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 22px;
}

/* ── 載入／錯誤 ─────────────────────────── */
.state-box {
  padding: 40px 24px;
  background: var(--cs-white);
  border: var(--cs-bw) solid var(--cs-ink);
  text-align: center;
}

.state-box h3 {
  margin: 0 0 8px;
  font-family: var(--cs-display);
  font-weight: 600;
  font-size: 21px;
}

.state-box p {
  margin: 0 0 16px;
  color: var(--cs-ink-mid);
}

.state-box .mono {
  font-size: var(--fs-data);
  color: var(--cs-ink-soft);
}

/* ── 手機底部拇指列 ─────────────────────── */
.thumb-bar {
  display: none;
}

/* ── 唯一斷點 ───────────────────────────── */
@media (max-width: 767px) {
  :root {
    --cs-px: 16px;
  }

  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  .masthead .wrap {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand-plate {
    width: 48px;
    height: 48px;
  }

  .wordmark {
    font-size: 20px;
  }

  .hero {
    padding-top: 22px;
  }

  .hero-sheet {
    padding: 22px 18px 20px;
  }

  .hero-sheet::before {
    width: 46%;
  }

  .hero h1 {
    font-size: clamp(28px, 7.6vw, 36px);
    line-height: 1.22;
  }

  .section {
    padding: 30px 0 8px;
  }

  .section-head h2 {
    font-size: clamp(21px, 5.6vw, 25px);
  }

  .index-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .catalogue {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .item-body {
    padding: 16px 16px 18px;
  }

  .item-name {
    font-size: 22px;
  }

  .item-actions .btn {
    flex: 1 1 auto;
  }

  .next-steps {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .thumb-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--cs-stock);
    border-top: var(--cs-bw) solid var(--cs-ink);
  }

  .thumb-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 58px;
    color: var(--cs-ink);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow var(--cs-ease);
  }

  .thumb-bar a + a {
    border-left: var(--cs-bw) solid var(--cs-ink);
    background: var(--cs-green);
    color: var(--cs-stock);
  }

  /* 按下去：沒有空間位移，改成內凹的實心墨影（仍是零模糊） */
  .thumb-bar a:active {
    box-shadow: inset 3px 3px 0 var(--cs-ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
