/* ============================================================
 *  人生博物館 · 展場設計 (Gallery Design)
 *  簡約優雅 · 美術館風 × 3D 列印典藏電商
 * ============================================================ */

:root {
  --wall:   #f4f1ea;
  --wall-2: #ebe6db;
  --ink:    #1c1a17;
  --muted:  #6f6a60;
  --line:   #d8d1c4;
  --brass:  #9a7b4f;
  --ok:     #4f7a5b;
  --shadow:
    0 1px 2px rgba(28, 26, 23, .05),
    0 10px 28px -14px rgba(28, 26, 23, .25),
    0 26px 64px -32px rgba(28, 26, 23, .42);

  --serif: "Cormorant Garamond", "Noto Serif TC", "Songti SC", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, "PingFang TC", "Helvetica Neue", "Microsoft JhengHei", sans-serif;
  --pad: clamp(1.5rem, 5vw, 6rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font-family: var(--sans); line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  animation: fadeIn .6s ease both;
}
::selection { background: var(--brass); color: #fff; }
img { max-width: 100%; }
code { background: var(--wall-2); padding: .1em .4em; border-radius: 4px; }

/* 紙張顆粒:整站鋪一層極淡的紙纖維質地 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 6; pointer-events: none;
  opacity: .10; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* 細銅卷軸列 */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--wall-2); }
::-webkit-scrollbar-thumb {
  background: #c6bba4; border-radius: 6px; border: 3px solid var(--wall-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--brass); }

/* 線稿圖標系統 */
.icon { display: inline-block; vertical-align: -.18em; flex-shrink: 0; }
.btn .icon { vertical-align: -.22em; margin-right: .15em; }

/* ---------- 按鈕(hover 帶一道光澤掃過) ---------- */
.btn {
  display: inline-block; border: 1px solid var(--ink); background: transparent;
  color: var(--ink); font-family: var(--sans); font-size: .9rem; letter-spacing: .08em;
  padding: .8rem 1.6rem; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .3s, color .3s, border-color .3s, transform .2s;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ""; position: absolute; top: 0; left: -130%;
  width: 55%; height: 100%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
  transition: left .7s ease;
}
.btn:hover::after { left: 145%; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: var(--wall); }
.btn--primary:hover { background: var(--brass); border-color: var(--brass); }
.btn--ghost:hover { border-color: var(--brass); color: var(--brass); }
.btn--small { padding: .55rem 1.1rem; font-size: .8rem; }

/* ---------- 序廳 ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: var(--pad); position: relative;
  background: radial-gradient(120% 90% at 50% -10%, var(--wall) 40%, var(--wall-2) 100%);
}
/* 序廳開場:逐行揭幕,標題字距由鬆收攏(揭牌感) */
.hero__inner { max-width: 48rem; }
.hero__inner > * { opacity: 0; animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.hero__eyebrow {
  font-family: var(--serif); font-weight: 600;
  font-size: .88rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 2rem;
  animation-delay: .15s;
}
.hero__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: .06em;
  margin: 0; line-height: 1.1;
  animation-name: trackIn; animation-duration: 1.3s; animation-delay: .35s;
}
@keyframes trackIn {
  from { opacity: 0; letter-spacing: .3em; transform: translateY(22px); }
  to   { opacity: 1; letter-spacing: .06em; transform: none; }
}
.hero__tagline {
  font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.55rem);
  margin: 1.6rem auto .8rem; max-width: 36rem;
  animation-delay: .65s;
}
.hero__pitch {
  color: var(--muted); max-width: 34rem; margin: 0 auto; font-size: .98rem;
  animation-delay: .95s;
}
.hero__cta {
  margin-top: 2.8rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  animation-delay: 1.15s;
}

/* 菱形飾線(線 — ◇ — 線) */
.ornament {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  margin: 1.4rem auto; animation-delay: .8s;
}
.ornament::before, .ornament::after {
  content: ""; width: 58px; height: 1px; background: var(--line);
}
.ornament span {
  width: 7px; height: 7px; border: 1px solid var(--brass);
  transform: rotate(45deg); flex-shrink: 0;
}
.ornament--footer { margin: 1.1rem auto; }
.hero__scroll {
  position: absolute; bottom: 2rem; font-size: 1.3rem; color: var(--muted);
  animation: bob 2.4s ease-in-out infinite;
}

/* ---------- 展廳通用 ---------- */
.hall { padding: clamp(4rem, 10vw, 7.5rem) var(--pad); border-top: 1px solid var(--line); }
.hall--steps { background: var(--wall-2); }
.hall__head { max-width: 62ch; margin: 0 auto clamp(2.5rem, 6vw, 4rem); text-align: center; }
.hall__no { font-size: .75rem; letter-spacing: .3em; color: var(--brass); text-transform: uppercase; margin: 0 0 1rem; }
.hall__name { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 4.5vw, 2.5rem); letter-spacing: .04em; margin: 0; }
/* 標題下的銅線:進場時自己畫出來 */
.hall__name::after {
  content: ""; display: block; width: 64px; height: 2px;
  background: var(--brass); margin: 1.1rem auto 0;
  transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1) .35s;
}
.hall__head.in .hall__name::after { transform: scaleX(1); }
.hall__intro { color: var(--muted); margin: 1rem auto 0; max-width: 42rem; }

/* ---------- 典藏流程 ---------- */
.steps {
  max-width: 68rem; margin: 0 auto; display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.step {
  text-align: center; padding: 2rem 1.2rem; background: var(--wall); border: 1px solid var(--line);
  transition-property: opacity, transform, box-shadow;
  position: relative; overflow: hidden;
}
/* 幽靈編號:卡片右上角的大型襯線數字 */
.step::before {
  content: attr(data-no); position: absolute; top: -.6rem; right: .6rem;
  font-family: var(--serif); font-weight: 500; font-size: 4.6rem; line-height: 1;
  color: var(--brass); opacity: .10; pointer-events: none;
}
/* 四格依序進場 */
.steps .step:nth-child(2) { transition-delay: .12s; }
.steps .step:nth-child(3) { transition-delay: .24s; }
.steps .step:nth-child(4) { transition-delay: .36s; }
.step:hover { box-shadow: var(--shadow); transform: translateY(-4px); transition-delay: 0s; }
.step:hover .step__icon .icon { animation: iconNudge .5s ease; }
@keyframes iconNudge { 50% { transform: translateY(-4px) scale(1.08); } }
.step__icon .icon { transition: transform .3s ease; }
.step__icon { color: var(--brass); }
.step__no { font-size: .7rem; letter-spacing: .28em; color: var(--brass); margin: 1rem 0 .3rem; }
.step__title { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 .5rem; }
.step__desc { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- 生命長廊:沉浸式 3D 展廳 ---------- */
.hall--3d { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.hall--3d .hall__head { padding: 0 var(--pad); }

.hall3d-wrap { position: relative; height: min(80vh, 760px); }
.hall3d { position: absolute; inset: 0; }
.hall3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* 展廳暗角:讓畫面有劇場聚光感 */
.hall3d-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(28, 26, 23, .18) 100%),
    linear-gradient(to bottom, rgba(28, 26, 23, .08), transparent 12%);
}

.hallnav {
  position: absolute; top: 44%; z-index: 3;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(253, 251, 246, .82);
  backdrop-filter: blur(6px);
  font-size: 1.6rem; line-height: 1; color: var(--ink); cursor: pointer;
  transition: background .25s, border-color .25s, transform .2s;
}
.hallnav:hover { border-color: var(--brass); color: var(--brass); transform: scale(1.06); }
.hallnav--prev { left: clamp(.8rem, 3vw, 2.5rem); }
.hallnav--next { right: clamp(.8rem, 3vw, 2.5rem); }

.hallhint {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 3; margin: 0; pointer-events: none;
  font-size: .78rem; letter-spacing: .18em; color: var(--muted);
  background: rgba(253, 251, 246, .75); backdrop-filter: blur(6px);
  padding: .4rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
}

/* 展台銘牌卡(展廳下緣) */
.hallpanel {
  position: absolute; left: 50%; bottom: clamp(1rem, 3.5vw, 2.2rem);
  transform: translateX(-50%); z-index: 3;
  width: min(92%, 34rem);
}
.hallpanel__body {
  display: flex; align-items: center; gap: 1.1rem;
  background: rgba(253, 251, 246, .88); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-top: 3px solid var(--brass);
  box-shadow: var(--shadow);
  padding: 1rem 1.4rem;
  animation: rise .5s ease both;
}
.hallpanel__icon { color: var(--brass); display: flex; align-items: center; }
.hallpanel__text { flex: 1; min-width: 0; }
.hallpanel__name { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: .04em; margin: 0; }
.hallpanel__meta { font-size: .8rem; color: var(--muted); letter-spacing: .05em; margin: .15rem 0 0; }
.hallpanel__actions { flex-shrink: 0; }

@media (max-width: 540px) {
  .hall3d-wrap { height: 72vh; }
  .hallpanel__body { flex-wrap: wrap; gap: .6rem 1rem; }
  .hallpanel__actions { width: 100%; }
  .hallpanel__actions .btn { width: 100%; }
  .hallnav { display: none; }
}

/* ---------- 里程碑展位 ---------- */
.stones {
  max-width: 76rem; margin: 0 auto; display: grid;
  gap: clamp(1.5rem, 3.5vw, 2.6rem);
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.stone {
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.stone:hover { transform: translateY(-6px); }
.stone__stage {
  height: 300px; position: relative;
  background: radial-gradient(100% 85% at 50% 20%, #fdfbf6 30%, var(--wall-2) 100%);
}
.stone__stage canvas { display: block; }
.stone__ph {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: .8rem; text-align: center;
}
.stone__icon { font-size: 3.4rem; filter: grayscale(1); opacity: .45; }
.stone--pending .stone__icon { filter: grayscale(.4); opacity: .8; }
.stone__ph-note { font-size: .82rem; letter-spacing: .15em; color: var(--muted); line-height: 1.6; }
.stone--locked .stone__stage { background: repeating-linear-gradient(45deg, var(--wall) 0 14px, var(--wall-2) 14px 28px); }

.stone__plaque { padding: 1.2rem 1.4rem 1.5rem; border-top: 1px solid var(--line); }
.stone__name { font-family: var(--serif); font-size: 1.3rem; margin: 0; }
.stone__meta { font-size: .8rem; color: var(--muted); letter-spacing: .05em; margin: .35rem 0 1rem; min-height: 2.2em; }
.stone--unlocked .stone__meta { color: var(--ok); }
.stone__actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.stone--just { animation: glow 2.6s ease; }
@keyframes glow {
  0%, 100% { box-shadow: var(--shadow); }
  30% { box-shadow: 0 0 0 4px var(--brass), var(--shadow); }
}

.no3d { display: flex; height: 100%; justify-content: center; align-items: center; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- 對話框(推門而入) ---------- */
.modal { border: none; padding: 0; background: transparent; max-width: min(92vw, 34rem); }
.modal::backdrop { background: rgba(28, 26, 23, .55); backdrop-filter: blur(3px); }
.modal[open]::backdrop { animation: fadeIn .35s ease; }
.modal[open] .modal__box { animation: modalIn .4s cubic-bezier(.2, .7, .2, 1); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
}
.modal__box { background: var(--wall); border: 1px solid var(--line); padding: 2.2rem; box-shadow: var(--shadow); }
.modal__box--wide { max-width: 34rem; }
.modal__title { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 .6rem; }
.modal__desc { font-size: .9rem; color: var(--muted); margin: 0 0 1.4rem; }
.modal__input {
  width: 100%; font-size: 1.3rem; letter-spacing: .2em; text-align: center;
  font-family: var(--serif); padding: .7rem; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-transform: uppercase;
}
.modal__input:focus { outline: 2px solid var(--brass); }
.modal__err { color: #a2543f; font-size: .85rem; min-height: 1.4em; margin: .6rem 0 0; }
.modal__actions { display: flex; gap: .8rem; justify-content: flex-end; margin-top: 1.4rem; flex-wrap: wrap; }
.share__preview { border: 1px solid var(--line); background: #fff; padding: .6rem; }
.share__preview img { display: block; width: 100%; }

/* ---------- 頁尾 ---------- */
.footer { text-align: center; padding: clamp(3rem, 8vw, 5rem) var(--pad); border-top: 1px solid var(--line); }
.footer__line { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .12em; margin: 0 0 .4rem; }
.footer__caps {
  font-family: var(--serif); font-weight: 600; font-size: .78rem;
  letter-spacing: .35em; text-transform: uppercase; color: var(--brass); margin: 0;
}
.footer__note { font-size: .82rem; color: var(--muted); margin: 0; }
.footer__note span { color: var(--brass); }

/* ============================================================
 *  下單頁 (order.html)
 * ============================================================ */
.order-page { background: var(--wall); }
.order-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem var(--pad); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: color-mix(in srgb, var(--wall) 88%, transparent);
  backdrop-filter: blur(8px); z-index: 5;
}
.order-top__back { color: var(--ink); text-decoration: none; font-size: .9rem; }
.order-top__back:hover { color: var(--brass); }
.order-top__brand { font-size: .75rem; letter-spacing: .28em; color: var(--brass); margin: 0; text-transform: uppercase; }

.wizard { max-width: 60rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) var(--pad) 6rem; }

.wsteps {
  display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 3rem;
  justify-content: center; flex-wrap: wrap;
}
.wsteps li {
  font-size: .78rem; letter-spacing: .12em; color: var(--muted);
  padding: .45rem 1.1rem; border: 1px solid var(--line); background: #fff;
  counter-increment: wstep;
}
.wsteps li.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.wsteps li.done { border-color: var(--ok); color: var(--ok); }

/* 步驟切換:翻頁感 */
.wpane { animation: paneIn .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes paneIn {
  from { opacity: 0; transform: translateY(22px); }
}

.wpane__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin: 0 0 1rem; }
.wpane__hint { font-size: .88rem; color: var(--muted); margin: 0 0 1.6rem; }
.wnav { display: flex; justify-content: space-between; margin-top: 2.5rem; gap: 1rem; }

/* Step1 里程碑選擇 */
.mgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mcard {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: #fff; border: 1px solid var(--line); padding: 1.3rem .8rem;
  cursor: pointer; text-align: center; transition: border-color .25s, transform .2s;
}
.mcard:hover { transform: translateY(-3px); }
.mcard:has(input:checked) { border-color: var(--brass); outline: 2px solid var(--brass); animation: pick .35s ease; }
@keyframes pick { 50% { transform: scale(1.035); } }
.mcard--off { opacity: .45; cursor: not-allowed; }
.mcard input { position: absolute; opacity: 0; }
.mcard__icon { color: var(--brass); }
.mcard__name { font-family: var(--serif); font-size: 1.05rem; }
.mcard__hint { font-size: .74rem; color: var(--muted); }

.custom-box { margin-top: 1.2rem; background: #fff; border: 1px solid var(--line); padding: 1.2rem 1.4rem; }
.custom-box__label { cursor: pointer; font-family: var(--serif); font-size: 1.05rem; }
.custom-box__fields { display: grid; gap: .8rem; grid-template-columns: 2fr 1fr; margin-top: 1rem; }
.custom-box__fields input {
  padding: .7rem .9rem; border: 1px solid var(--line); background: var(--wall);
  font-family: var(--sans); font-size: .95rem;
}
.custom-box__fields input:focus { outline: 2px solid var(--brass); }

/* Step2 上傳 */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  border: 2px dashed var(--line); background: #fff; padding: 3rem 1.5rem;
  cursor: pointer; text-align: center; color: var(--muted);
  transition: border-color .25s, background .25s;
}
.drop:hover, .drop--over { border-color: var(--brass); background: #fdfbf6; }
.drop__icon { color: var(--brass); }
.previews { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.4rem; }
.pv {
  position: relative; width: 110px; height: 110px; border: 1px solid var(--line);
  background: #fff; padding: 4px;
  animation: pop .35s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv__x {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px;
  border-radius: 50%; border: none; background: var(--ink); color: #fff;
  font-size: .7rem; cursor: pointer;
}
.pv__x:hover { background: #a2543f; }

/* Step3 風格 / 尺寸 */
.stylepick { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.scard {
  background: #fff; border: 1px solid var(--line); cursor: pointer; overflow: hidden;
  transition: border-color .25s, transform .2s;
}
.scard:hover { transform: translateY(-3px); }
.scard--on { border-color: var(--brass); outline: 2px solid var(--brass); animation: pick .35s ease; }
.scard__stage { height: 260px; background: radial-gradient(100% 85% at 50% 20%, #fdfbf6 30%, var(--wall-2) 100%); }
.scard__stage canvas { display: block; }
.scard__body { padding: 1rem 1.3rem 1.3rem; border-top: 1px solid var(--line); }
.scard__body h3 { font-family: var(--serif); margin: 0 0 .3rem; font-size: 1.2rem; }
.scard__body p { margin: 0; font-size: .85rem; color: var(--muted); }
.scard__price { margin-top: .5rem !important; color: var(--brass) !important; font-weight: 600; }

.sizepick { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.zcard {
  display: flex; flex-direction: column; gap: .2rem; align-items: center;
  background: #fff; border: 1px solid var(--line); padding: 1.2rem;
  cursor: pointer; transition: border-color .25s;
}
.zcard--on { border-color: var(--brass); outline: 2px solid var(--brass); animation: pick .35s ease; }
.zcard__name { font-family: var(--serif); font-size: 1.3rem; }
.zcard__note { font-size: .78rem; color: var(--muted); }
.zcard__price { font-weight: 600; color: var(--brass); margin-top: .3rem; }

/* Step4 摘要 */
.summary { background: #fff; border: 1px solid var(--line); padding: 1.8rem; }
.sum { display: grid; grid-template-columns: 7em 1fr; gap: .6rem 1rem; margin: 0; }
.sum dt { color: var(--muted); font-size: .88rem; }
.sum dd { margin: 0; font-family: var(--serif); }
.sum__price { font-size: 1.3rem; color: var(--brass); font-weight: 600; }
.sum__photos { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.sum__photos img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); padding: 3px; background: #fff; }

/* Step4 收件資料 */
.rform { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.rform label { display: flex; flex-direction: column; gap: .45rem; font-size: .85rem; color: var(--muted); }
.rform input, .rform textarea {
  padding: .75rem .95rem; border: 1px solid var(--line); background: #fff;
  font-family: var(--sans); font-size: .96rem; color: var(--ink); resize: vertical;
}
.rform input:focus, .rform textarea:focus { outline: 2px solid var(--brass); }
.rform--full { grid-column: 1 / -1; }
@media (max-width: 540px) { .rform { grid-template-columns: 1fr; } }

/* 完成畫面 */
.done { text-align: center; max-width: 34rem; margin: 0 auto; }
.done__icon { color: var(--brass); margin-bottom: .6rem; }
.done__card { background: #fff; border: 1px solid var(--line); padding: 1.4rem 1.8rem; margin: 1.6rem 0; text-align: left; }
.done__row { display: flex; justify-content: space-between; margin: .4rem 0; font-size: .95rem; }
.done__row span { color: var(--muted); }
.done__demo { background: var(--wall-2); border: 1px dashed var(--brass); padding: 1rem 1.3rem; font-size: .92rem; margin: 0 0 2rem; }

/* 典藏卡（出貨盒內實體卡預覽）:呈上感 */
.keepsake {
  width: min(300px, 100%); margin: 0 auto 1rem;
  background: linear-gradient(160deg, #fdfbf6, #f1ecdf);
  border: 2px solid var(--brass); padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow); text-align: center;
  animation: cardIn .8s cubic-bezier(.2, .7, .2, 1) .25s both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) scale(.95); } }
.keepsake__brand { font-size: .68rem; letter-spacing: .3em; color: var(--brass); text-transform: uppercase; margin: 0 0 1rem; }
.keepsake__qr { display: flex; justify-content: center; }
.keepsake__qr canvas { border: 1px solid var(--line); padding: 6px; background: #fff; }
.keepsake__code { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .25em; margin: 1rem 0 .4rem; }
.keepsake__note { font-size: .8rem; color: var(--muted); margin: 0; }

/* ============================================================
 *  大廳(lobby.html)
 * ============================================================ */
.hero--lobby { min-height: 62svh; }

/* 我的博物館概況 */
.mymuseum { max-width: 46rem; margin: 0 auto; }
.mymuseum__body {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brass);
  box-shadow: var(--shadow); padding: 2rem 2.2rem; text-align: center;
}
.mymuseum__stats { display: flex; justify-content: center; gap: 3rem; margin-bottom: 1.2rem; }
.mystat strong { font-family: var(--serif); font-size: 2rem; display: block; }
.mystat span { font-size: .75rem; letter-spacing: .18em; color: var(--muted); }
.mymuseum__dots { margin-bottom: 1.6rem; }
.mymuseum__actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* 展館目錄卡 */
.gcards {
  max-width: 72rem; margin: 0 auto; display: grid;
  gap: clamp(1.4rem, 3vw, 2.2rem);
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.gcard {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brass);
  box-shadow: var(--shadow); padding: 1.8rem 1.7rem 1.6rem;
  display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
  transition-property: opacity, transform, box-shadow;
}
.gcard:hover { transform: translateY(-6px); }
.gcard__owner { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); margin: 0; }
.gcard__title { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; letter-spacing: .04em; margin: 0; }
.gcard__motto { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .95rem; margin: 0; min-height: 3em; }
.gcard__dots { margin: .2rem 0; }
.gcard__meta { font-size: .78rem; color: var(--muted); letter-spacing: .04em; margin: 0 0 .8rem; }

/* 里程碑收藏點 */
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: inset 0 -1px 2px rgba(28, 26, 23, .25);
}
.dot--off { background: transparent; border: 1px solid var(--line); box-shadow: none; }

/* ============================================================
 *  邀請制門禁(憑柬入場)
 * ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 40;
  display: flex; justify-content: center; align-items: center;
  padding: var(--pad);
  background: radial-gradient(120% 90% at 50% -10%, var(--wall) 40%, var(--wall-2) 100%);
}
.gate__card {
  width: min(92vw, 27rem); text-align: center;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brass);
  box-shadow: var(--shadow); padding: 2.6rem 2.4rem 2.2rem;
  animation: modalIn .5s cubic-bezier(.2, .7, .2, 1) both;
}
.gate__eyebrow {
  font-family: var(--serif); font-weight: 600; font-size: .75rem;
  letter-spacing: .32em; text-transform: uppercase; color: var(--brass); margin: 0 0 1rem;
}
.gate__title { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; letter-spacing: .05em; margin: 0; }
.gate__card .ornament { margin: 1rem auto; animation: none; opacity: 1; }
.gate__desc { font-size: .9rem; color: var(--muted); margin: 0 0 1.4rem; }
.gate__actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.3rem; flex-wrap: wrap; }
.gate__hint {
  margin: 1.6rem 0 0; padding-top: 1.2rem; border-top: 1px dashed var(--line);
  font-size: .8rem; color: var(--muted);
}

/* 邀請碼小字 */
.gcard__code, .mymuseum__code { font-size: .76rem; color: var(--muted); letter-spacing: .05em; margin: .5rem 0 0; }
.gcard__code code, .mymuseum__code code { color: var(--brass); background: var(--wall); }

/* ============================================================
 *  簽名簿
 * ============================================================ */
.gb { max-width: 44rem; margin: 0 auto; }
.gb__list { margin-bottom: 2.5rem; }
.gb__empty { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; }
.gbentry { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.gbentry:first-child { border-top: 1px solid var(--line); }
.gbentry__text { font-family: var(--serif); font-size: 1.1rem; line-height: 1.8; margin: 0 0 .4rem; }
.gbentry__text::before { content: "「"; color: var(--brass); }
.gbentry__text::after  { content: "」"; color: var(--brass); }
.gbentry__sig { text-align: right; font-size: .85rem; color: var(--muted); margin: 0; }
.gbentry__sig span { font-size: .75rem; letter-spacing: .08em; margin-left: .6em; opacity: .8; }

.gbform { display: grid; gap: .9rem; }
.gbform input, .gbform textarea {
  padding: .8rem 1rem; border: 1px solid var(--line); background: #fff;
  font-family: var(--sans); font-size: .95rem; color: var(--ink); resize: vertical;
}
.gbform input:focus, .gbform textarea:focus { outline: 2px solid var(--brass); }
.gbform .btn { justify-self: end; }

/* ============================================================
 *  公開參觀模式（?visit 訪客視角）
 * ============================================================ */
.mode-visit { padding-bottom: 72px; }           /* 幫底部轉化列留空間 */
.mode-visit .adminlink { display: none; }       /* 訪客看不到職人後台入口 */

.visitbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; align-items: center; gap: 1.2rem;
  padding: .8rem var(--pad);
  padding-bottom: calc(.8rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--wall); backdrop-filter: blur(8px);
  animation: rise .8s ease both;
}
.visitbar__text { font-family: var(--serif); font-size: .95rem; letter-spacing: .06em; }
.visitbar .btn--primary { background: var(--brass); border-color: var(--brass); color: #fff; }
.visitbar .btn--primary:hover { background: var(--wall); color: var(--ink); border-color: var(--wall); }
.visitbar__lobby { color: var(--wall); border-color: rgba(244, 241, 234, .5); }
.visitbar__lobby:hover { border-color: var(--wall); color: var(--wall); }
@media (max-width: 540px) { .visitbar__text { display: none; } }

.stone__viewhint { font-size: .8rem; color: var(--muted); letter-spacing: .05em; }

/* 輕提示 */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 30; background: var(--ink); color: var(--wall);
  padding: .7rem 1.4rem; font-size: .88rem; letter-spacing: .05em;
  box-shadow: var(--shadow); animation: rise .4s ease both;
}

/* ============================================================
 *  職人後台 (admin.html)
 * ============================================================ */
.adminwrap { max-width: 64rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--pad) 6rem; }

.astats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 2.5rem; }
.astat {
  background: #fff; border: 1px solid var(--line); padding: 1rem 1.2rem; text-align: center;
  animation: rise .55s ease both;
}
.astat:nth-child(2) { animation-delay: .07s; }
.astat:nth-child(3) { animation-delay: .14s; }
.astat:nth-child(4) { animation-delay: .21s; }
.astat:nth-child(5) { animation-delay: .28s; }
.astat span { display: block; font-size: .75rem; color: var(--muted); letter-spacing: .1em; }
.astat strong { font-family: var(--serif); font-size: 1.6rem; }
.astat--money strong { color: var(--brass); }

.aorder {
  display: flex; justify-content: space-between; gap: 1.5rem;
  background: #fff; border: 1px solid var(--line); padding: 1.3rem 1.5rem; margin-bottom: 1rem;
  animation: rise .5s ease both;
  transition: box-shadow .3s ease, transform .3s ease;
}
.aorder:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.aorder:nth-child(2) { animation-delay: .06s; }
.aorder:nth-child(3) { animation-delay: .12s; }
.aorder:nth-child(4) { animation-delay: .18s; }
.aorder:nth-child(5) { animation-delay: .24s; }
.aorder:nth-child(6) { animation-delay: .3s; }
.aorder__head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.aorder__id { font-family: var(--serif); letter-spacing: .05em; }
.aorder__meta { font-size: .85rem; color: var(--muted); margin: .4rem 0 .8rem; }
.aorder__thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.aorder__thumbs img {
  width: 56px; height: 56px; object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--line); padding: 2px; background: #fff;
}
.aorder__nophoto { font-size: .8rem; color: var(--muted); }
.aorder__note {
  font-size: .85rem; background: var(--wall-2); border-left: 3px solid var(--brass);
  padding: .5rem .8rem; margin: .2rem 0 .8rem;
}
.aorder__actions { display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; justify-content: center; flex-shrink: 0; }
.aorder__code { font-size: .78rem; color: var(--muted); }

.badge { font-size: .72rem; letter-spacing: .08em; padding: .2rem .7rem; border: 1px solid; border-radius: 2px; }
.b-model { color: #b08a3e; border-color: #b08a3e; background: #fdf6e8; }
.b-print { color: #4f6b7d; border-color: #4f6b7d; background: #eef4f8; }
.b-ship  { color: var(--ok); border-color: var(--ok); background: #eef6f0; }
.b-done  { color: var(--brass); border-color: var(--brass); background: #f8f3ea; }

.aempty { background: #fff; border: 1px dashed var(--line); padding: 3rem; text-align: center; color: var(--muted); }
.aempty a { color: var(--brass); }

.aphotos { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: 60vh; overflow-y: auto; }
.aphotos img { width: 100%; border: 1px solid var(--line); }

/* 典藏卡列印:平常隱藏,列印時只印卡片 */
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  .keepsake--print { box-shadow: none; margin: 2cm auto; }
}

@media (max-width: 640px) {
  .aorder { flex-direction: column; }
  .aorder__actions { align-items: stretch; }
}

/* ---------- 動畫 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes bob  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes fadeIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal, .hero__inner > * { opacity: 1; transform: none; }
  .hall__name::after { transform: scaleX(1); }
}
@media (max-width: 540px) {
  .custom-box__fields { grid-template-columns: 1fr; }
  .wnav { flex-direction: column-reverse; }
  .wnav .btn { width: 100%; }
}
