:root {
  --bg: #f5f1ea;
  --paper: #fbf9f5;
  --ink: #1e1a16;
  --ink-2: #5d554c;
  --ink-3: #9a9086;
  --line: #e4ddd2;
  --accent: #a8644a;
  --accent-soft: #efe2d8;
  --green: #06c755;
  --radius: 14px;
  --serif: 'Noto Serif TC', 'Songti TC', serif;
  --latin: 'Cormorant Garamond', 'Noto Serif TC', serif;
  --sans: 'Noto Sans TC', -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --header-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
body.locked { overflow: hidden; }

/* 跑馬燈 */
.notice { background: var(--ink); color: #f3ece2; font-size: 12.5px; letter-spacing: .08em; overflow: hidden; white-space: nowrap; height: 32px; display: flex; align-items: center; }
.notice-track { display: inline-flex; gap: 64px; padding-left: 100%; animation: marquee 28s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* Header */
.header { position: sticky; top: 0; z-index: 40; background: rgba(245, 241, 234, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.header.scrolled { border-bottom-color: var(--line); }
.header-in { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo-main { font-family: var(--latin); font-size: 30px; font-weight: 600; letter-spacing: .12em; line-height: 1; }
.logo-sub { font-family: var(--serif); font-size: 12px; letter-spacing: .3em; color: var(--ink-2); }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav button { background: none; border: 0; padding: 6px 0; color: var(--ink-2); position: relative; }
.nav button:hover, .nav button.on { color: var(--ink); }
.nav button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink); }
.header-actions { display: flex; gap: 4px; }
.icon-btn { background: none; border: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.bag-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; transform: scale(0); transition: transform .25s; }
.bag-count.show { transform: scale(1); }
.bag-count.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.35); } }
.searchbar { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.searchbar.open { max-height: 80px; }
.searchbar input { width: 100%; margin: 4px 0 14px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font: inherit; outline: none; }
.searchbar input:focus { border-color: var(--ink-3); }

/* Hero */
.hero { padding: 56px 0 72px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.eyebrow { font-family: var(--latin); font-size: 14px; letter-spacing: .28em; color: var(--accent); margin: 0 0 10px; font-weight: 600; }
.hero-title { font-family: var(--serif); font-size: clamp(38px, 5.2vw, 66px); line-height: 1.22; margin: 0 0 22px; font-weight: 700; letter-spacing: .02em; }
.hero-title em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }
.hero-lead { color: var(--ink-2); font-size: 16px; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { list-style: none; padding: 0; margin: 40px 0 0; display: flex; gap: 36px; }
.hero-stats b { display: block; font-family: var(--latin); font-size: 34px; line-height: 1; font-weight: 600; }
.hero-stats span { font-size: 12.5px; color: var(--ink-3); letter-spacing: .1em; }
.hero-visual { position: relative; height: min(640px, 72vw); border-radius: 22px; overflow: hidden; background: var(--line); }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; cursor: pointer; }
.slide.on { opacity: 1; visibility: visible; transition: opacity .9s ease; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 6.5s ease-out; }
.slide.on img { transform: scale(1); }
.slide::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(20,16,12,.55)); }
.slide figcaption { position: absolute; left: 26px; right: 26px; bottom: 58px; z-index: 2; color: #fff; transform: translateY(14px); opacity: 0; transition: all .7s .3s; }
.slide.on figcaption { transform: none; opacity: 1; }
.slide figcaption small { font-family: var(--latin); letter-spacing: .25em; font-size: 13px; opacity: .9; }
.slide figcaption b { display: block; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; margin: 2px 0 6px; }
.slide figcaption span { font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,.7); padding-bottom: 2px; }
.slider-ui { position: absolute; left: 26px; right: 18px; bottom: 20px; z-index: 3; display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 6px; flex: 1; }
.dots button { flex: 1; max-width: 46px; height: 15px; border: 0; padding: 0; background: none; position: relative; }
.dots button::before, .dots button i { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); }
.dots button i { right: auto; width: 0; background: #fff; }
.dots button.on i { animation: fill var(--dur, 5s) linear forwards; }
.dots button.done i { width: 100%; }
.hero-visual.paused .dots button.on i { animation-play-state: paused; }
@keyframes fill { to { width: 100%; } }
.slide-count { color: #fff; font-family: var(--latin); font-size: 15px; letter-spacing: .1em; }
.slide-arrow { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); color: #fff; font-size: 20px; line-height: 1; backdrop-filter: blur(6px); }
.slide-arrow:hover { background: #fff; color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 28px; border-radius: 999px; border: 1px solid var(--ink); font-size: 15px; letter-spacing: .06em; transition: background .2s, color .2s, transform .15s; background: none; }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #3a332c; }
.btn-line:hover, .btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { border-color: var(--line); }
.btn-linegreen { background: var(--green); border-color: var(--green); color: #fff; font-weight: 500; }
.btn-linegreen:hover { background: #05b14b; }
.btn.block { width: 100%; }

/* Sections */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head.center { justify-content: center; text-align: center; }
.section-title { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); margin: 0; font-weight: 700; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 22px; line-height: 1; }
.round-btn:hover { border-color: var(--ink); }
.rail-ctrl { display: flex; gap: 8px; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 23vw, 290px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px max(20px, calc((100vw - 1240px) / 2)) 16px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }

/* Category tiles */
.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile { position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; border: 0; padding: 0; background: var(--line); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile span { position: absolute; inset: auto 0 0 0; padding: 40px 14px 14px; background: linear-gradient(transparent, rgba(20,16,12,.62)); color: #fff; font-family: var(--serif); font-size: 16px; text-align: left; }
.cat-tile small { display: block; font-family: var(--sans); font-size: 12px; opacity: .85; }

/* Chips / grid */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 16px; font-size: 14px; transition: all .2s; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip i { font-style: normal; opacity: .55; margin-left: 4px; font-size: 12px; }
.sort { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px; }
.result-info { color: var(--ink-3); font-size: 13px; margin: 0 0 18px; min-height: 1em; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 20px; }
.empty { text-align: center; color: var(--ink-3); padding: 60px 0; }

.card { cursor: pointer; animation: rise .6s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card-img { position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s, transform 1s; }
.card-img img.alt { opacity: 0; }
.card:hover .card-img img.alt { opacity: 1; }
.card:hover .card-img img { transform: scale(1.03); }
.badges { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.badge { position: relative; background: var(--paper); font-family: var(--latin); font-weight: 600; font-size: 13px; letter-spacing: .15em; padding: 2px 10px; border-radius: 999px; }
.quick { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(251,249,245,.94); display: grid; place-items: center; font-size: 20px; opacity: 0; transform: translateY(6px); transition: all .25s; }
.card:hover .quick { opacity: 1; transform: none; }
.quick:hover { background: var(--ink); color: var(--paper); }
.card-body { padding: 12px 2px 0; }
.card-name { font-size: 15px; font-weight: 500; margin: 0; line-height: 1.45; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: 13px; color: var(--ink-3); }
.swatches { display: flex; gap: 4px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.card-price { font-size: 13.5px; color: var(--accent); margin-top: 3px; }

/* How */
.how { background: var(--paper); border-block: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps li { background: var(--bg); border-radius: var(--radius); padding: 28px 26px; }
.step-n { font-family: var(--latin); font-size: 38px; color: var(--accent); line-height: 1; font-weight: 600; }
.steps h3 { font-family: var(--serif); margin: 12px 0 8px; font-size: 19px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.size-note { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 28px 0 0; }

/* Footer */
.footer { padding: 48px 0 28px; }
.footer-in { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.foot-tag { color: var(--ink-3); margin: 10px 0 0; font-size: 14px; }
.foot-links { display: flex; gap: 24px; font-size: 14px; align-items: center; }
.linklike { background: none; border: 0; padding: 0; color: var(--green); font-weight: 500; }
.copy { text-align: center; color: var(--ink-3); font-size: 12px; margin: 40px 0 0; letter-spacing: .08em; }

/* Modal */
.modal, .drawer { position: fixed; inset: 0; z-index: 60; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28, 22, 17, .45); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: absolute; inset: 4vh 0 auto; margin: auto; width: min(1080px, 94vw); max-height: 92vh; background: var(--paper); border-radius: 20px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(251,249,245,.92); font-size: 24px; line-height: 1; }
.modal-x.static { position: static; }
.modal-x:hover { background: var(--ink); color: var(--paper); }
.gallery { background: #ece6dd; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.g-main { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.g-main::-webkit-scrollbar { display: none; }
.g-main img { flex: 0 0 100%; width: 100%; height: 100%; max-height: 92vh; object-fit: contain; scroll-snap-align: center; }
.g-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: var(--paper); border-top: 1px solid var(--line); }
.g-thumbs button { flex: 0 0 56px; height: 72px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: none; opacity: .6; }
.g-thumbs button.on { border-color: var(--ink); opacity: 1; }
.g-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail { padding: 40px 38px 36px; overflow-y: auto; }
.d-code { font-family: var(--latin); letter-spacing: .2em; color: var(--ink-3); margin: 0; font-size: 14px; font-weight: 600; }
.d-name { font-family: var(--serif); font-size: 28px; margin: 4px 0 6px; line-height: 1.35; }
.d-price { color: var(--accent); font-size: 16px; margin: 0 0 14px; }
.d-intro { color: var(--ink-2); margin: 0 0 22px; }
.d-block { margin-bottom: 20px; }
.d-block h4, .d-more-title { margin: 0 0 10px; font-size: 13px; letter-spacing: .12em; color: var(--ink-2); font-weight: 500; }
.d-block h4 span { color: var(--ink); margin-left: 6px; letter-spacing: 0; }
.d-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.d-colors button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 14px; }
.d-colors button.on { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.d-colors .sw { width: 16px; height: 16px; }
.d-sizes { list-style: none; margin: 0; padding: 12px 16px; background: var(--bg); border-radius: 10px; font-size: 14px; }
.d-sizes li + li { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.qty-block { display: flex; align-items: center; gap: 16px; }
.qty-block h4 { margin: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 38px; height: 36px; border: 0; background: none; font-size: 18px; }
.qty span { min-width: 26px; text-align: center; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 28px; }
.d-feats { margin: 0; padding: 0; list-style: none; }
.d-feats li { position: relative; padding-left: 22px; margin-bottom: 6px; font-size: 14.5px; }
.d-feats li::before { content: ''; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); transform: scale(.7); }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.d-tags span { font-size: 12.5px; color: var(--ink-3); }
.d-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.d-more .card-name { font-size: 13px; }
.d-more .card-meta { display: none; }

/* Drawer */
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--paper); display: flex; flex-direction: column; animation: slide .35s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 22px; }
.bag-item { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.bag-item img { width: 74px; height: 96px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.bag-item h5 { margin: 0; font-size: 14.5px; font-weight: 500; }
.bag-item p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.bag-item .qty { margin-top: 8px; }
.bag-item .qty button { width: 30px; height: 28px; font-size: 15px; }
.bag-del { background: none; border: 0; color: var(--ink-3); font-size: 13px; align-self: start; }
.bag-del:hover { color: var(--accent); }
.bag-empty { text-align: center; color: var(--ink-3); padding: 70px 10px; }
.drawer-foot { padding: 16px 22px 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.bag-sum { margin: 0; font-size: 14px; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--ink); color: var(--paper); padding: 12px 22px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 90; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 1080px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .hero { padding: 28px 0 40px; }
  .hero-in { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { height: 128vw; max-height: 600px; }
  .modal-card { inset: auto 0 0; width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; grid-template-columns: minmax(0, 1fr); overflow-y: auto; overflow-x: hidden; animation-name: up; }
  @keyframes up { from { transform: translateY(100%); } }
  .gallery { height: 70vh; flex: none; }
  .detail { padding: 24px 20px 40px; overflow: visible; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 28px); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .section { padding: 40px 0; }
  .hero-stats { gap: 24px; }
  .quick { opacity: 1; transform: none; width: 34px; height: 34px; font-size: 17px; }
  .card-name { font-size: 14px; }
  .d-actions { grid-template-columns: 1fr; }
  .rail { grid-auto-columns: 62vw; padding-inline: 14px; }
  .rail-ctrl { display: none; }
  .logo-main { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 熱銷 */
.badge.hot { background: var(--accent); color: #fff; font-family: var(--sans); letter-spacing: .1em; }
.badge.rank { background: var(--ink); color: var(--paper); }
.section-sub { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; }
