/* 前台：紅紙招牌風格（後台樣式在 admin.css） */
:root {
  --red: #c8322b;
  --red-deep: #9f231e;
  --yellow: #f6c343;
  --paper: #fff4e0;
  --note: #fffbef;
  --ink: #1d1a17;
  --ink-2: #5c5248;
  --faint: #ead9bb;
  --on-red: #fff6e3;
  --hand: 'LXGW WenKai TC', 'Kaiti TC', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.shop {
  margin: 0;
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(120, 80, 30, .07) 1px, transparent 1px);
  background-size: 5px 5px;
}
.shop a { color: var(--red-deep); text-underline-offset: 3px; }
.shop h1, .shop h2 { margin: 0; line-height: 1.2; }
.shop p { margin: 0 0 .7em; }
.shop svg { max-width: 100%; }

/* ---------- 頁首：跑馬條＋印章 logo ---------- */
.ticker {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px;
  background: var(--ink); color: var(--paper); font-size: .85rem; padding: 7px 16px; letter-spacing: .05em;
}
.ticker span + span::before { content: '／'; margin-right: 18px; opacity: .4; }
.site-head { display: flex; align-items: center; justify-content: space-between; max-width: 1040px; margin: 0 auto; padding: 14px 16px; }
.seal {
  display: grid; place-items: center; width: 64px; height: 64px;
  background: var(--red); color: var(--on-red) !important; text-decoration: none;
  border-radius: 8px; transform: rotate(-4deg);
  font: 700 1rem/1.05 var(--hand); letter-spacing: .08em; box-shadow: 2px 3px 0 var(--ink);
}
.seal span { display: block; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--ink) !important; text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--red-deep) !important; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 30px; border: 2.5px solid var(--ink); border-radius: 10px;
  background: var(--yellow); color: var(--ink) !important; text-decoration: none;
  font: 700 1.3rem var(--hand); letter-spacing: .1em; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn-red { background: var(--red); color: var(--on-red) !important; }
.btn-ghost { background: var(--paper); border-color: var(--ink-2); color: var(--ink-2) !important; box-shadow: 3px 3px 0 var(--ink-2); }
.btn-block { width: 100%; }

/* ---------- 主視覺：紅紙大字 ---------- */
.hero {
  position: relative; background: var(--red); color: var(--on-red);
  display: flex; justify-content: space-between; gap: 16px;
  padding: 36px max(16px, calc(50% - 504px)) 92px;
  -webkit-mask: radial-gradient(11px at 50% 100%, #0000 97%, #000) 50% / 22px 100%;
  mask: radial-gradient(11px at 50% 100%, #0000 97%, #000) 50% / 22px 100%;
}
.hero-kicker { font: 700 1.05rem var(--hand); color: var(--yellow); letter-spacing: .12em; }
.hero h1 { font: 700 clamp(3.2rem, 15vw, 7.5rem)/1.08 var(--hand); letter-spacing: .02em; margin: 6px 0 26px; }
.hero-num {
  display: inline-block; color: var(--ink); background: var(--yellow);
  border-radius: 50%; min-width: 1.25em; padding: 0 .12em; margin: 0 .08em;
  text-align: center; font-size: .9em; line-height: 1.25em; transform: rotate(-6deg);
}
.hero-sub { font-size: 1.05rem; max-width: 28em; margin-top: -10px !important; }
.hero-vertical {
  writing-mode: vertical-rl; font: 700 clamp(1.1rem, 4vw, 1.7rem) var(--hand);
  letter-spacing: .35em; color: var(--yellow); border-right: 2px solid color-mix(in srgb, var(--yellow) 50%, transparent);
  padding-right: 10px; margin: 6px 0 0 !important; white-space: nowrap; align-self: flex-start;
}

/* ---------- 「正」字計數板 ---------- */
.board {
  position: relative; max-width: 760px; width: calc(100% - 32px); margin: -56px auto 0; padding: 26px 20px 20px;
  background: var(--note); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--ink);
}
.board.is-compact { width: 100%; margin: 28px 0 0; }
.board::before, .board::after {
  content: ''; position: absolute; top: -14px; width: 92px; height: 26px;
  background: color-mix(in srgb, var(--yellow) 75%, transparent); border: 1px solid rgba(0, 0, 0, .06);
}
.board::before { left: 18px; transform: rotate(-6deg); }
.board::after { right: 18px; transform: rotate(5deg); }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.board-head h2 { font: 700 1.5rem var(--hand); }
.board-head p { color: var(--ink-2); font-size: .9rem; margin: 0; }
.tally { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 18px 0 12px; }
.zheng { width: 54px; height: 54px; }
.zheng path { fill: none; stroke-width: 10; stroke-linecap: round; }
.zheng .off { stroke: var(--faint); }
.zheng .on { stroke: var(--ink); }
.tally-num { font: 700 3rem var(--hand); margin: 10px 0 !important; }
.board-foot { border-top: 2px dashed var(--faint); padding-top: 10px; margin: 0 !important; }
.board-foot b { color: var(--red); font-size: 1.3em; }
.board-note { color: var(--ink-2); font-size: .9rem; margin: 6px 0 0 !important; }

/* ---------- 區塊標題 ---------- */
.h2 {
  display: inline-block; font: 700 clamp(1.9rem, 7vw, 2.6rem) var(--hand); letter-spacing: .06em; margin-bottom: 18px !important;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--yellow) 80%, transparent) 62%, color-mix(in srgb, var(--yellow) 80%, transparent) 92%, transparent 92%);
}
.section { max-width: 1040px; margin: 70px auto 0; padding: 0 16px; }
/* 置中的區塊（來預購吧、常常被問）：標題與文字置中，卡片本身置中但內容靠左 */
.section.center { text-align: center; }
.section.center .product-desc { margin: 0 auto; }
.section.center .wizard, .section.center .closed, .section.center .chat { margin-left: auto; margin-right: auto; text-align: left; }

/* ---------- 三格漫畫 ---------- */
.comic { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 44px; counter-reset: p; }
.comic li {
  position: relative; counter-increment: p; background: var(--note); border: 2.5px solid var(--ink); border-radius: 8px;
  padding: 32px 18px 20px; text-align: center; box-shadow: 5px 5px 0 var(--ink);
}
.comic li:nth-child(2) { background: var(--yellow); }
.comic li::before {
  content: counter(p); position: absolute; top: -20px; left: 16px; width: 40px; height: 40px;
  background: var(--red); color: var(--on-red); border: 2.5px solid var(--ink); border-radius: 6px; transform: rotate(-6deg);
  font: 700 1.3rem/35px var(--hand); text-align: center;
}
.comic li + li::after {
  content: '↓'; position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  font: 700 1.8rem var(--hand); color: var(--red);
}
.comic-art { display: block; width: auto; height: 110px; margin: 0 auto 12px; }
.comic p { font: 700 1.25rem/1.5 var(--hand); margin: 0; }
.story-end { text-align: center; font: 700 1.6rem var(--hand); color: var(--red-deep); margin: 34px 0 0 !important; }
@media (min-width: 760px) {
  .comic { grid-template-columns: repeat(3, 1fr); gap: 46px; }
  .comic li + li::after { content: '→'; top: 50%; left: -38px; transform: translateY(-50%); }
}

/* ---------- 預購四個字 ---------- */
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.how li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.how b {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1;
  background: var(--red); color: var(--on-red); border: 2.5px solid var(--ink); border-radius: 8px;
  font: 700 clamp(3.5rem, 18vw, 6rem) var(--hand); box-shadow: 4px 4px 0 var(--ink);
}
.how li:nth-child(2) b { background: var(--yellow); color: var(--ink); }
.how li:nth-child(4) b { background: var(--ink); }
.how span { font-weight: 500; }
@media (min-width: 760px) { .how ol { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 預購：三步驟 ---------- */
.product { font-size: 1.1rem; font-weight: 700; margin-top: -6px !important; }
.product-desc { max-width: 40em; color: var(--ink-2); }
.wizard {
  max-width: 640px; margin-top: 18px; padding: 22px 18px 20px; background: #fffdf7;
  border: 2.5px solid var(--ink); border-top: 8px double var(--red); border-radius: 6px;
  box-shadow: 6px 6px 0 var(--ink); scroll-margin-top: 16px;
}
.dots { list-style: none; padding: 0; margin: 0 0 22px; display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: d; }
.is-wizard .dots { display: grid; }
.dots li {
  counter-increment: d; display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
  border-bottom: 3px solid var(--faint); color: var(--ink-2); font-weight: 700; font-size: .88rem; white-space: nowrap;
}
.dots li::before {
  content: counter(d); display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  border: 2px solid var(--ink-2); border-radius: 4px; font: 700 1rem var(--hand);
}
.dots li.on { color: var(--ink); border-color: var(--red); }
.dots li.on::before { background: var(--red); color: var(--on-red); border-color: var(--ink); }
/* 沒有 JavaScript 時三步驟全部攤開，上一步／下一步按鈕不顯示 */
.wizard:not(.is-wizard) [data-go] { display: none; }
.wizard:not(.is-wizard) [data-pane] + [data-pane] { margin-top: 26px; }

.tags { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 14px; margin: 30px 0 6px; }
.tag {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 10px;
  padding: 26px 10px 14px; transform: rotate(var(--tilt)); box-shadow: 4px 4px 0 var(--ink);
}
.tag::before {
  content: ''; position: absolute; top: 9px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.tag::after { content: ''; position: absolute; bottom: calc(100% - 13px); left: 50%; width: 2px; height: 28px; background: var(--ink); }
.tag-jar { width: 34px; height: 41px; margin: 2px 0; }
.tag-name { font: 700 1.25rem var(--hand); text-align: center; }
.tag-price { font: 700 clamp(2.4rem, 11vw, 3.2rem)/1 var(--hand); }
.tag-price small { font-size: .45em; vertical-align: top; margin-right: 2px; }
.stepper { display: flex; align-items: center; margin-top: 10px; background: var(--ink); border-radius: 999px; overflow: hidden; }
.stepper button { width: 42px; height: 40px; border: 0; background: none; color: var(--paper); font-size: 1.3rem; cursor: pointer; }
.stepper input {
  width: 46px; height: 40px; border: 0; border-radius: 0; text-align: center; background: var(--paper); color: var(--ink);
  font: 700 1.2rem var(--sans); -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hint { text-align: center; color: var(--red-deep); font-weight: 700; margin: 12px 0 0 !important; }
.hint:empty { display: none; }
.shipnote { color: var(--ink-2); text-align: center; margin-top: 12px !important; }
.wizard .btn-block { margin-top: 14px; }

.slip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--ink-2); }
.stamp {
  display: inline-block; font: 700 1.4rem var(--hand); color: var(--red); border: 2.5px solid var(--red); border-radius: 6px;
  padding: 0 10px; transform: rotate(-3deg); letter-spacing: .2em; white-space: nowrap;
}
.stamp.is-muted { color: var(--ink-2); border-color: var(--ink-2); }
/* 訂購單式的欄位：標籤在左、虛線底線 */
.fields label { display: grid; grid-template-columns: 4.2em 1fr; align-items: end; gap: 8px; margin-bottom: 14px; font-weight: 500; }
.fields input {
  width: 100%; border: 0; border-bottom: 1.5px dashed var(--ink-2); background: transparent; border-radius: 0;
  padding: 6px 2px; font: 1.05rem var(--sans); color: var(--ink);
}
.fields input:focus { outline: none; border-bottom: 2px solid var(--red); }
.fields input::placeholder { color: color-mix(in srgb, var(--ink-2) 55%, transparent); }

.nav-row { display: flex; gap: 10px; margin-top: 18px; }
.nav-row .btn { flex: 1; padding: 0 10px; font-size: 1.08rem; letter-spacing: .04em; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font: 700 1.2rem var(--hand); }
.receipt { margin: 14px 0; padding: 12px 0; border-top: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); font-variant-numeric: tabular-nums; }
.receipt > div { display: flex; justify-content: space-between; }
.receipt-total { font: 700 1.4rem var(--hand); margin-top: 4px; }
.to { background: var(--note); border-left: 5px solid var(--red); padding: 10px 14px; font-size: .95rem; }
.to:empty { display: none; }
.agree { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: .92rem; }
.agree input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--red); flex-shrink: 0; }
.secure { text-align: center; font-size: .82rem; color: var(--ink-2); margin: 12px 0 0 !important; }
.closed { background: var(--note); border: 2px dashed var(--ink-2); padding: 18px; border-radius: 8px; max-width: 640px; }

/* ---------- 對話問答 ---------- */
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; max-width: 700px; }
.q, .a { max-width: 86%; padding: 12px 16px; border: 2.5px solid var(--ink); border-radius: 18px; margin: 0 !important; }
.q { align-self: flex-start; background: var(--note); border-bottom-left-radius: 4px; font: 700 1.2rem var(--hand); box-shadow: 3px 3px 0 var(--ink); }
.a { align-self: flex-end; background: var(--yellow); border-bottom-right-radius: 4px; box-shadow: -3px 3px 0 var(--ink); }

/* ---------- 頁尾 ---------- */
.site-foot { margin-top: 80px; background: var(--ink); color: color-mix(in srgb, var(--on-red) 75%, var(--ink)); text-align: center; padding: 34px 16px 40px; }
.foot-brand { font: 700 1.6rem var(--hand); color: var(--yellow); letter-spacing: .15em; }
.site-foot a { color: var(--on-red) !important; }

/* ---------- 訂單、查訂單、訊息頁 ---------- */
.page { max-width: 640px; margin: 36px auto 0; padding: 0 16px; }
.status h1 { font: 700 clamp(2rem, 8vw, 2.6rem)/1.3 var(--hand); margin: 16px 0 10px; text-wrap: balance; }
.slip > .btn-block { margin-top: 10px; }
.status p { color: var(--ink-2); }
.slip {
  margin-top: 28px; padding: 22px 18px 18px; background: #fffdf7;
  border: 2.5px solid var(--ink); border-top: 8px double var(--red); border-radius: 6px; box-shadow: 6px 6px 0 var(--ink);
}
.detail { display: grid; grid-template-columns: 4.5em 1fr; gap: 6px 12px; margin: 0; }
.detail dt { color: var(--ink-2); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.form-error { background: color-mix(in srgb, var(--red) 12%, var(--note)); color: var(--red-deep); border-left: 5px solid var(--red); padding: 10px 14px; }
.page-note { color: var(--ink-2); font-size: .9rem; margin-top: 18px !important; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
