/* 扛扛 KangKang — components
   .key / .burst / .sticker-title / .bounce / .sparkle / .card / .marker / 表單 / 頁首 / 頁尾 / 小元件
   用法見 styleguide.html。 */

/* =========================================================
   .icon：SVG sprite（build 會把 partials/icons.html 放進每一頁）
   <svg class="icon" aria-hidden="true"><use href="#i-arrow-right"></use></svg>
   ========================================================= */
.icon { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.2em; }

/* =========================================================
   .key：鍵盤按鍵按鈕
   ========================================================= */
.key {
  --key-bg: var(--cream);
  --key-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  min-width: 44px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  color: var(--key-fg);
  background: var(--key-bg);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-key);
  box-shadow: 0 5px 0 var(--key-shadow);
  transform: translateY(0);
  transition:
    transform var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.key:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--key-shadow); }
.key:active,
.key.is-pressed,
.key[aria-pressed="true"] { transform: translateY(4px); box-shadow: 0 1px 0 var(--key-shadow); }
.key:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-key); }
.key:disabled,
.key[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--key-shadow); }
.key .icon { width: 1.3em; height: 1.3em; }

/* 朱紅底暖白字：字要 19px 以上粗體，加炭黑描邊（DESIGN.md 對比規則） */
.key--red {
  --key-bg: var(--red);
  --key-fg: var(--paper);
  font-size: var(--fs-on-red-min);
  font-weight: var(--fw-black);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  letter-spacing: 0.04em;
}
.key--red .icon { stroke-width: 3; filter: drop-shadow(0 0 0.5px var(--ink)); }
.key--paper { --key-bg: var(--paper); --key-fg: var(--ink); }
.key--oat { --key-bg: var(--oat-soft); --key-fg: var(--ink); }
.key--ink { --key-bg: var(--ink); --key-fg: var(--paper); }
/* 「用 LINE 登入」：LINE 的綠色（品牌色以外唯一的例外），字用炭黑（約 7:1） */
.key--line { --key-bg: #06C755; --key-fg: var(--ink); }
.key--line .icon { width: 24px; height: 24px; }
.key[aria-busy="true"] { cursor: progress; }

.key--icon { width: 52px; height: 52px; min-height: 52px; padding: 0; flex: none; }
.key--icon .icon { width: 24px; height: 24px; }
.key--sm { min-height: 44px; padding: 8px 16px; font-size: 0.9375rem; border-radius: 12px; }
.key--sm.key--red { font-size: var(--fs-on-red-min); }
.key--sm.key--icon { width: 44px; height: 44px; min-height: 44px; padding: 0; }
.key--lg { min-height: 60px; padding: 14px 30px; font-size: 1.125rem; }
.key--lg.key--red { font-size: 1.3125rem; }
.key--block { display: flex; width: 100%; }

/* 按鍵群組（箭頭鍵、進度點） */
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-bottom: 5px; }

/* =========================================================
   .burst：爆炸對話框（日文小字＋大字）
   <p class="burst" style="--tilt:-6deg">
     <span class="burst__jp" lang="ja">買い物代行</span>
     <span class="burst__big">代採購</span>
   </p>
   ========================================================= */
.burst {
  --tilt: -4deg;               /* 建議 -6deg ～ 4deg */
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  min-width: 10.5em;
  padding: 2.1em 2.6em 2em;
  color: var(--red);
  text-align: center;
  line-height: 1.08;
  rotate: var(--tilt);
}
.burst::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/svg/burst.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(6px 6px 0 var(--ink));
}
.burst__jp {
  font-family: var(--font-jp);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--red);
  line-height: 1.3;
}
.burst__big {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: var(--fw-black);
  letter-spacing: -0.01em;
  color: var(--red);
}
.burst__big.latin { font-family: var(--font-latin); font-weight: 800; letter-spacing: 0; }
.burst--sm { font-size: 0.8125rem; min-width: 9em; padding: 2em 2.3em 1.9em; }
.burst--sm .burst__big { font-size: 1.5rem; }
.burst--lg .burst__big { font-size: clamp(1.9rem, 4vw, 2.8rem); }

/* =========================================================
   .sticker-title：朱紅底上的描邊大標（暖白字＋炭黑描邊）
   ========================================================= */
.sticker-title {
  --sticker-stroke: clamp(4px, 0.1em, 10px);
  color: var(--paper);
  font-weight: var(--fw-black);
  -webkit-text-stroke: var(--sticker-stroke) var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.03em 0.055em 0 var(--ink);
  letter-spacing: -0.005em;
}
.sticker-title--red { color: var(--red); }
.sticker-title--oat { color: var(--oat); }

/* =========================================================
   .bounce：拆字、每個字些微上下位移和大小變化
   build.js 會先拆好（沒有 JS 也一樣）；動態內容用 KK.bounce(el)
   ========================================================= */
.bounce__w { display: inline-block; white-space: nowrap; }
.bounce__ch {
  display: inline-block;
  translate: 0 var(--dy, 0);
  scale: var(--s, 1);
  rotate: var(--r, 0deg);
  transform-origin: 50% 70%;
}
@media (prefers-reduced-motion: no-preference) {
  .bounce--wiggle .bounce__ch {
    animation: kk-hop 2.6s var(--ease-in-out) infinite;
    animation-delay: calc(var(--i, 0) * -0.19s);
  }
}
/* 捲到才一個一個跳進來：<h2 class="bounce" data-bounce-in> */
.motion .bounce[data-bounce-in] .bounce__ch { opacity: 0; transform: translateY(0.45em); }

@keyframes kk-hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.055em); }
}

/* =========================================================
   .sparkle：四角星，慢慢閃
   <img class="sparkle" src="assets/svg/sparkle.svg" alt="" style="--size:32px">
   <svg class="sparkle sparkle--red" aria-hidden="true"><use href="#i-sparkle"></use></svg>
   ========================================================= */
.sparkle {
  width: var(--size, 28px);
  height: var(--size, 28px);
  flex: none;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.sparkle--red { --sparkle-fill: var(--red); }
.sparkle--oat { --sparkle-fill: var(--oat); }
.sparkle--abs { position: absolute; left: var(--x, 0); top: var(--y, 0); z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .sparkle { animation: kk-twinkle var(--tw-dur, 3.2s) var(--ease-in-out) var(--tw-delay, 0s) infinite both; }
}
@keyframes kk-twinkle {
  0%, 100% { transform: scale(0.72) rotate(0deg); opacity: 0.6; }
  42% { transform: scale(1.08) rotate(14deg); opacity: 1; }
  58% { transform: scale(1) rotate(10deg); opacity: 1; }
}

/* =========================================================
   .card
   ========================================================= */
.card {
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --focus: var(--red);
  --key-shadow: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: clamp(20px, 3vw, 32px);
  background: var(--card-bg, var(--oat-soft));
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: 6px 6px 0 var(--card-shadow, var(--ink));
}
.card--cream { --card-bg: var(--cream); }
.card--paper { --card-bg: var(--paper); }
.card--oat { --card-bg: var(--oat); --fg-muted: var(--ink); }
.section--ink .card { --card-shadow: var(--red); }
.card__icon { width: 76px; height: 76px; margin-bottom: var(--space-2); }
.card__title { font-size: var(--fs-h3); line-height: 1.3; font-weight: var(--fw-black); color: var(--ink); }
.card__text { color: var(--ink); }
.card__eyebrow { font-family: var(--font-latin); font-weight: 700; font-size: var(--fs-tiny); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.card--link { transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.card--link:hover { transform: translate(-2px, -3px); box-shadow: 8px 9px 0 var(--card-shadow, var(--ink)); }
.card--link a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* 整張卡可點 */

/* =========================================================
   .marker：定位點＋說明卡（main.js 自動處理開關、Esc、點外面關）
   父層要 position: relative（例如 .marker-map）。--x/--y 是針尖的位置。
   ========================================================= */
.marker-map { position: relative; }
.marker {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 0;
  height: 0;
  z-index: 2;
}
.marker.is-open { z-index: var(--z-pop); }
.marker::before { /* 下方橢圓陰影 */
  content: "";
  position: absolute;
  left: -12px;
  top: -3px;
  width: 24px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.28;
}
.marker__pin {
  position: absolute;
  left: -24px;
  top: -55px;
  width: 48px;
  height: 60px;
  background: url("../assets/svg/marker-pin.svg") center / 48px 60px no-repeat;
  border-radius: 50% 50% 45% 45%;
  transition: transform var(--dur-2) var(--ease-spring);
  transform-origin: 50% 92%;
}
.marker__pin:hover,
.marker.is-open .marker__pin { transform: translateY(-4px) scale(1.06); }
.marker__pin:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.marker__label {
  position: absolute;
  left: 44px;
  top: 8px;
  padding: 2px 10px;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: var(--fw-bold);
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}
.marker--label-left .marker__label { left: auto; right: 44px; }
.marker--label-none .marker__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }
@media (prefers-reduced-motion: no-preference) {
  .marker__pin::after { /* 慢慢擴散的圓圈 */
    content: "";
    position: absolute;
    left: 50%;
    top: 38%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 2px solid var(--red);
    border-radius: 50%;
    opacity: 0;
    animation: kk-ping 2.4s var(--ease-out) infinite;
  }
  .marker.is-open .marker__pin::after { animation: none; }
}
@keyframes kk-ping {
  0% { transform: scale(0.5); opacity: 0.7; }
  80%, 100% { transform: scale(1.5); opacity: 0; }
}
.marker__pop {
  position: absolute;
  left: 0;
  bottom: 66px;
  width: min(280px, calc(100vw - 32px));
  translate: calc(-50% + var(--pop-shift, 0px)) 0;
  padding: 16px 18px 18px;
  background: var(--cream);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  font-size: 0.9375rem;
  line-height: 1.65;
  text-align: left;
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --focus: var(--red);
}
.marker__pop::after { /* 小尖角 */
  content: "";
  position: absolute;
  left: calc(50% - var(--arrow-shift, 0px));
  bottom: -9px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: var(--cream);
  border-right: var(--border-w) solid var(--ink);
  border-bottom: var(--border-w) solid var(--ink);
  rotate: 45deg;
}
.marker__pop.is-below { bottom: auto; top: 22px; }
.marker__pop.is-below::after { bottom: auto; top: -9px; rotate: 225deg; }
.marker__title { font-size: 1.0625rem; font-weight: var(--fw-black); line-height: 1.35; margin-bottom: 4px; padding-right: 36px; }
.marker__close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--ink);
}
.marker__close .icon { width: 20px; height: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .marker__pop:not([hidden]) { animation: kk-pop-in var(--dur-2) var(--ease-spring); }
}
@keyframes kk-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   表單欄位
   ========================================================= */
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-weight: var(--fw-bold); font-size: 0.9375rem; line-height: 1.4; color: var(--fg); }
.field__hint { font-size: var(--fs-small); line-height: 1.6; color: var(--fg-muted); }
.field__error {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--ink);
}
.field__error::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--red); color: var(--ink); font-family: var(--font-latin); font-weight: 800; font-size: 0.85em; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--cream);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-field);
  font-family: var(--font-sans);
  font-size: 1rem;                /* 16px：iOS 不會放大 */
  font-weight: var(--fw-medium);
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: box-shadow var(--dur-1) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:focus, .select:focus, .textarea:focus { outline: none; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--red); outline-offset: 2px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.input--num, .input[type="number"] { font-family: var(--font-latin); font-variant-numeric: tabular-nums; font-weight: 500; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { opacity: 1; }
.select {
  padding-right: 44px;
  background: var(--cream) url("../assets/svg/select-arrow.svg") right 12px center / 20px 20px no-repeat;
  cursor: pointer;
}
.textarea { min-height: 128px; resize: vertical; line-height: 1.65; }

/* 欄位後面加單位：<div class="input-affix"><input class="input"><span class="input-affix__unit">cm</span></div> */
.input-affix { position: relative; display: flex; align-items: stretch; }
.input-affix .input { padding-right: 3.2em; }
.input-affix__unit {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--muted);
  pointer-events: none;
}
.input-affix--pre .input { padding-left: 3em; padding-right: 14px; }
.input-affix--pre .input-affix__unit { right: auto; left: 14px; }

/* 核取方塊、單選 */
.check { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: var(--fw-medium); line-height: 1.5; }
.check input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream);
  border: var(--border-w) solid var(--ink);
  border-radius: 7px;
  cursor: pointer;
  transition: background-color var(--dur-1);
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--red) url("../assets/svg/check.svg") center / 18px 18px no-repeat; }
.check input[type="radio"]:checked { background: var(--cream); box-shadow: inset 0 0 0 5px var(--cream), inset 0 0 0 12px var(--red); }
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* 開關：<label class="switch"><input type="checkbox" role="switch"><span>有電梯</span></label> */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: var(--fw-medium); line-height: 1.5; }
.switch input {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out);
}
.switch input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: translate var(--dur-2) var(--ease-spring);
}
.switch input:checked { background: var(--red); }
.switch input:checked::before { translate: 22px 0; background: var(--paper); box-shadow: 0 0 0 2px var(--ink); }
.switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* 分段選擇（按鍵造型，選到的那顆是按下去的狀態）
   <fieldset class="segmented"><legend class="field__label">送到哪裡</legend>
     <div class="segmented__opts">
       <label><input type="radio" name="mode" value="home" checked><span>送到府</span></label> …
     </div></fieldset> */
.segmented { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.segmented legend { padding: 0; margin-bottom: 8px; }
.segmented__opts { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 5px; }
.segmented label { position: relative; display: inline-flex; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented label > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  background: var(--cream);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-key);
  box-shadow: 0 5px 0 var(--ink);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), background-color var(--dur-2);
}
.segmented label:hover > span { transform: translateY(-1px); box-shadow: 0 6px 0 var(--ink); }
.segmented input:checked + span { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); background: var(--ink); color: var(--paper); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 4px; }
.segmented--block .segmented__opts > label { flex: 1 1 0; }
.segmented--block label > span { width: 100%; }

/* =========================================================
   小元件
   ========================================================= */
/* 會員頭像（js/member.js 做的）：燕麥底圓形、炭黑細框（用 box-shadow，不佔版面）、
   底下是名字第一個字，上面蓋 LINE 頭像；頭像載不到就只看到字。大小用 --size */
.avatar {
  --size: 40px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--oat);
  color: var(--ink);
  box-shadow: 0 0 0 var(--border-w) var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--fw-black);
  font-size: calc(var(--size) * 0.46);
  line-height: 1;
  letter-spacing: 0;
  overflow: hidden;
  -webkit-text-stroke: 0;
}
.avatar__initial { display: block; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--oat); }

/* 剛從 LINE 登入回來：頁首下面跳出「登入好了，歡迎 名字！」4 秒（js/member.js）。
   手機置中、桌機靠右（在會員鍵下面）；不擋點擊（pointer-events: none），不會蓋到試算頁底部的總價列 */
.member-hello {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: var(--gutter);
  z-index: 45;                          /* 比頁首（50）、手機選單（60）低，比試算頁總價列（40）高 */
  width: max-content;
  max-width: min(380px, calc(100% - 2 * var(--gutter)));
  pointer-events: none;
}
.member-hello__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.member-hello.is-in .member-hello__card { opacity: 1; transform: none; }
.member-hello__avatar { --size: 36px; }
.member-hello__text { margin: 0; font-weight: var(--fw-black); line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 899.98px) {
  .member-hello { left: 50%; right: auto; translate: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .member-hello__card { transform: none; transition: opacity var(--dur-2) linear; }
}

/* 暫定／估 標籤 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  min-height: 1.6em;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: var(--fw-bold);
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: 0.15em;
  letter-spacing: 0.02em;
}
.badge--oat { background: var(--oat); }
.badge--ink { background: var(--ink); color: var(--paper); }

/* 提醒框 */
.notice {
  position: relative;
  padding: 14px 16px 14px 20px;
  background: var(--oat-soft);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: 14px;
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow: hidden;
}
.notice::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--red); border-right: var(--border-w) solid var(--ink); }

/* 吉祥物（整組輕輕上下晃，像在走路） */
.mascot { display: block; position: relative; }
.mascot img { display: block; width: 100%; height: auto; }
/* 吉祥物腳下的影子（圖本身不帶影子，換任何底色都乾淨）：中間深、往外淡，像貼地的軟影 */
.mascot--ground { isolation: isolate; }
.mascot--ground::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -2%;
  z-index: -1;
  height: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(32, 30, 29, 0.36), rgba(32, 30, 29, 0.16) 58%, rgba(32, 30, 29, 0));
  pointer-events: none;
}
/* 兩個扛仔一起抬（kangzai-duo）：左右各一團影子，對準兩雙腳 */
.mascot--pair::after {
  left: 3%;
  right: 3%;
  height: 9%;
  border-radius: 0;
  background:
    radial-gradient(closest-side, rgba(32, 30, 29, 0.36), rgba(32, 30, 29, 0.16) 58%, rgba(32, 30, 29, 0)) left top / 32% 100% no-repeat,
    radial-gradient(closest-side, rgba(32, 30, 29, 0.36), rgba(32, 30, 29, 0.16) 58%, rgba(32, 30, 29, 0)) right top / 32% 100% no-repeat;
}
/* 吉祥物放在朱紅底：扛仔的頭也是朱紅，加一圈米白描邊，像貼紙 */
.section--red .mascot img,
.theme-red .mascot img {
  filter:
    drop-shadow(3px 0 0 var(--paper)) drop-shadow(-3px 0 0 var(--paper))
    drop-shadow(0 3px 0 var(--paper)) drop-shadow(0 -3px 0 var(--paper));
}
@media (prefers-reduced-motion: no-preference) {
  .mascot--walk img { animation: kk-walk 1.2s var(--ease-in-out) infinite; transform-origin: 50% 100%; }
}
@keyframes kk-walk {
  0%, 100% { transform: translateY(0) rotate(-0.7deg); }
  25% { transform: translateY(-1.6%) rotate(0deg); }
  50% { transform: translateY(0) rotate(0.7deg); }
  75% { transform: translateY(-1.6%) rotate(0deg); }
}

/* 影片框（Logo 動畫） */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.video-frame video, .video-frame img { width: 100%; height: 100%; object-fit: cover; }

/* 輪播進度點（按鈕 44px 高，看得到的點比較小） */
.dots { display: flex; align-items: center; gap: 2px; }
.dots__dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
}
.dots__dot::before {
  content: "";
  width: 12px;
  height: 12px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  transition: width var(--dur-2) var(--ease-out), background-color var(--dur-2);
}
.dots__dot[aria-current="true"]::before, .dots__dot.is-active::before { width: 26px; background: var(--red); }
.dots__dot:focus-visible { outline-offset: -2px; border-radius: 10px; }

/* 清單：打勾 */
.checklist { list-style: none; padding: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 22px;
  height: 22px;
  border: var(--border-w) solid var(--ink);
  border-radius: 6px;
  background: var(--red) url("../assets/svg/check.svg") center / 15px 15px no-repeat;
}

/* 金額列（估價單） */
.receipt { display: grid; gap: 0; }
.receipt__row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 2px dashed var(--ink); }
.receipt__row small { display: block; }
.receipt__row .num { font-weight: 700; white-space: nowrap; }
.receipt__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 16px; flex-wrap: wrap; }

/* =========================================================
   頁首
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--paper);
  color: var(--ink);
  border-bottom: var(--border-w) solid var(--ink);
  --fg: var(--ink);
  --focus: var(--red);
  --key-shadow: var(--ink);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}
.site-logo { display: inline-flex; align-items: center; flex: none; min-height: 44px; text-decoration: none; border-radius: 6px; }
.site-logo img { height: 30px; width: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); flex: 1 1 auto; justify-content: flex-end; }
.site-nav__list { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 32px); list-style: none; padding: 0; margin: 0 auto; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-weight: var(--fw-bold);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out);
}
.site-nav__link:hover::after, .site-nav__link[aria-current="page"]::after { transform: scaleX(1); }
.site-nav__link .icon { display: none; }
.site-header__toggle { display: none; }
.site-header__toggle .icon-close { display: none; }
.site-header__toggle[aria-expanded="true"] .icon-open { display: none; }
.site-header__toggle[aria-expanded="true"] .icon-close { display: block; }

/* 頁首右邊：會員登入；背景音樂鍵在最右邊（開著時是按下去的炭黑鍵） */
.site-header__tools { display: flex; align-items: center; gap: 12px; flex: none; }
.site-header__sound { flex: none; }
.site-header__sound .icon-sound-on,
.site-header__sound[aria-pressed="true"] .icon-sound-off { display: none; }
.site-header__sound[aria-pressed="true"] .icon-sound-on { display: block; }
.site-header__sound[aria-pressed="true"] { --key-bg: var(--ink); --key-fg: var(--paper); }
.site-header__login { gap: 8px; padding-inline: 16px 18px; min-height: 52px; }
.site-header__login .icon { width: 22px; height: 22px; }
/* 登入後（js/member.js）：圖示換成 22px 頭像、字換成「會員」，大小和「登入」一樣，版面不會動 */
.site-header__avatar { --size: 22px; font-size: 0.75rem; }
/* 登入過的人：等 /api/me 回來之前，只把鍵裡面藏起來（框留著，不跳動；head.html 最多藏 2.5 秒） */
html.kk-member-wait .site-header__login > * { visibility: hidden; }
.site-nav__cta { white-space: nowrap; flex: none; }
/* 桌機最窄那段（900–1099）：選單字小一點、間距縮一點，才放得下音樂鍵和登入鍵 */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .site-header__bar { gap: 12px; }
  .site-logo img { height: 26px; }
  .site-nav { gap: 14px; }
  .site-nav__list { gap: 14px; }
  .site-nav__link { font-size: 0.9375rem; }
  .site-header__tools { gap: 8px; }
}
/* 選單比較擠的寬度：登入只留圖示（文字給螢幕閱讀器）；登入後只剩頭像，放大到 30px 才認得出來（鍵的大小不變） */
@media (max-width: 1239.98px) {
  .site-header__login { width: 52px; padding: 0; }
  .site-header__login-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .site-header__avatar { --size: 30px; font-size: 0.9375rem; }
}

@media (max-width: 899.98px) {
  .site-header__bar { gap: 8px; }
  .site-header__tools { margin-left: auto; gap: 8px; }
  .site-header__sound,
  .site-header__login { width: 48px; height: 48px; min-height: 48px; }
  .site-logo img { height: 24px; }
  .site-header__toggle { display: inline-flex; width: 48px; height: 48px; min-height: 48px; }
  .site-nav {
    --fg: var(--ink);
    --focus: var(--ink);
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 28px;
    padding: 16px var(--gutter) 40px;
    background: var(--red);
    border-top: var(--border-w) solid var(--ink);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
  }
  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s;
  }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .site-nav__link {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 10px 0;
    border-bottom: var(--border-w) solid var(--ink);
    font-size: clamp(1.625rem, 7.5vw, 2.25rem);
    font-weight: var(--fw-black);
    color: var(--ink);
  }
  .site-nav__link::after { display: none; }
  .site-nav__link .icon { display: block; width: 28px; height: 28px; }
  .site-nav__link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 0.18em; }
  .site-nav__cta.key--red { --key-bg: var(--paper); --key-fg: var(--ink); -webkit-text-stroke: 0; min-height: 60px; font-size: 1.25rem; }
  html.menu-open { overflow: hidden; }
}
/* 很窄的手機（320–359px）：logo 小一點、三顆鍵 44px，才不會左右滑（原本要 360px 才放得下） */
@media (max-width: 359.98px) {
  .site-header__bar { gap: 6px; }
  .site-logo img { height: 20px; }
  .site-header__sound,
  .site-header__login,
  .site-header__toggle { width: 44px; height: 44px; min-height: 44px; }
}

/* =========================================================
   頁尾（炭黑底）
   ========================================================= */
.site-footer {
  --bg: var(--ink); --fg: var(--paper); --fg-muted: var(--oat); --focus: var(--red); --key-shadow: var(--oat);
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(72px, 10vw, 140px) 28px;
  overflow: hidden;
}
.site-footer__big {
  font-size: clamp(2.5rem, 8.4vw, 7.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: var(--fw-black);
  color: var(--paper);
  max-width: 12em;
}
.site-footer__big .text-red { color: var(--red); }
.site-footer__cta { margin-top: var(--space-7); }
.site-footer__grid {
  display: grid;
  gap: var(--space-6) var(--space-7);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-top: clamp(56px, 8vw, 104px);
  padding-top: var(--space-6);
  border-top: var(--border-w) solid var(--muted);
}
.site-footer__h {
  font-size: 0.8125rem;
  font-family: var(--font-latin);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oat);
  margin-bottom: var(--space-3);
}
.site-footer__h span { font-family: var(--font-sans); letter-spacing: 0.06em; }
.site-footer__list { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 0.875rem; line-height: 1.65; }
.site-footer__list a { color: var(--paper); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.site-footer__list a:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.site-footer__note { font-size: var(--fs-small); line-height: 1.7; color: var(--oat); }
.site-footer__logo img { height: 34px; width: auto; }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: var(--border-w) solid var(--muted);
  font-family: var(--font-latin);
  font-size: var(--fs-small);
  color: var(--oat);
}
.site-footer .sparkle--abs { opacity: 0.9; }
