@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+TC:wght@400;500;700;900&display=swap');

/* =============================================================
 * 宋韻 - songyun
 * 宋代美學：宣紙底、青瓷、墨、朱砂印、淡金。
 * 極簡留白、細線框景、襯線寬字距——讓茶品如冊頁清供般高級淡雅。
 * 手機優先、老人友善。選擇器與侘寂（wabi）一一對應。
 * ============================================================= */
:root {
  --bg: #F6F1E7;          /* 宣紙 */
  --paper: #F6F1E7;       /* 紙（同宣紙，供印章／反白字使用） */
  --card: #FDFBF6;        /* 卡片紙白 */
  --ink: #2E2C26;         /* 墨 */
  --ink-soft: #4E4A3E;
  --muted: #7A7263;       /* 次要文字 */
  --line: #DDD3BE;        /* 邊框線 */
  --celadon: #7E968A;     /* 青瓷綠・主色 */
  --celadon-deep: #55705F;/* 深青瓷・hover */
  --cinnabar: #A63D2E;    /* 朱砂・僅點綴（特價、印章、倒數） */
  --gold: #B08D57;        /* 淡金・價格、細線裝飾、kicker */
  --danger: #A63D2E;
  --radius: 3px;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU",
               "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", serif;
  line-height: 1.9;
  letter-spacing: .04em;
}
::selection { background: rgba(126, 150, 138, .35); }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* ---------- 頁首：三區同基線、間距均勻、留白對稱 ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 3px double var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; padding: 20px 20px 16px;
}
.logo {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink); font-size: 1.3rem; font-weight: 900;
  text-decoration: none; letter-spacing: .35em; line-height: 1.2;
  flex: 0 0 auto;
}
.logo img { max-height: 46px; width: auto; vertical-align: middle; }
.main-nav {
  display: flex; gap: 30px; flex-wrap: nowrap; align-items: baseline;
}
.main-nav a {
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  padding: 6px 1px; font-size: .95rem; letter-spacing: .2em; line-height: 1.4;
}
/* hover 淡金底線：用 background 漸變線展開，不佔版面、零位移 */
.main-nav a:not(.cart-link) {
  background: linear-gradient(var(--gold), var(--gold))
              left calc(100% - 1px) / 0% 1px no-repeat;
  transition: background-size .3s ease, color .25s ease;
}
.main-nav a:not(.cart-link):hover { color: var(--celadon-deep); background-size: 100% 1px; }
.main-nav a:active { color: var(--ink); }
.cart-link {
  border: 1px solid var(--celadon-deep); border-radius: var(--radius);
  color: var(--ink) !important; padding: 7px 16px !important;
  margin-left: 2px;
  transition: background-color .25s ease, color .25s ease;
}
.cart-link:hover { background: var(--celadon); color: var(--card) !important; }

/* 手機：logo 獨占首排，導覽改單排橫捲（不擠多排、不溢出，隱藏捲軸） */
@media (max-width: 699px) {
  .header-inner {
    flex-wrap: wrap; align-items: center;
    gap: 4px 16px; padding: 14px 20px 8px;
  }
  .logo { font-size: 1.12rem; letter-spacing: .28em; }
  .logo img { max-height: 40px; }
  .main-nav {
    order: 2; flex: 1 1 100%;
    flex-wrap: nowrap; align-items: center;
    gap: 24px; padding: 8px 2px 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 93%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 93%, transparent);
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 6px 0; }
}

/* ---------- 朱砂方印（裝飾） ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  background: var(--cinnabar); color: var(--card);
  font-family: "Ma Shan Zheng", "Noto Serif TC", serif;
  font-size: 1.15rem; line-height: 1; letter-spacing: 0;
  border-radius: 2px; transform: rotate(-3deg);
  box-shadow: inset 0 0 0 1.5px rgba(253, 251, 246, .45);
}
.seal--sm { width: 29px; height: 29px; font-size: .98rem; }

/* ---------- 主視覺：宣紙冊頁、直書題字、墨字水印 ---------- */
.hero {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 88px 20px 76px;
  border-bottom: 3px double var(--line);
  margin-bottom: 52px;
}
.hero-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  font-family: "Ma Shan Zheng", "Noto Serif TC", serif;
  font-size: clamp(11rem, 42vw, 17rem); line-height: 1;
  color: rgba(46, 44, 38, .05);
  pointer-events: none; user-select: none; z-index: 0;
}
.hero-vertical {
  position: absolute; top: 50%; right: 16px;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: "Ma Shan Zheng", "Noto Serif TC", serif;
  font-size: 1.12rem; letter-spacing: .42em;
  color: rgba(46, 44, 38, .26);
  pointer-events: none; user-select: none; z-index: 1;
}
.hero-kicker, .hero h1, .hero-seal-row, .hero-sub, .hero .btn {
  position: relative; z-index: 1;
}
.hero-kicker {
  margin: 0 0 22px; color: var(--gold);
  font-size: .95rem; font-weight: 700; letter-spacing: .5em; text-indent: .5em;
}
.hero h1 {
  margin: 0 0 14px; font-weight: 900;
  font-size: 2.6rem; letter-spacing: .3em; text-indent: .3em;
}
.hero-seal-row { margin: 0 0 20px; }
.hero-sub {
  margin: 0 0 42px; color: var(--ink-soft);
  font-size: 1.05rem; letter-spacing: .4em; text-indent: .4em;
}
.hero .btn { max-width: 320px; margin: 0 auto; }

/* ---------- 分類：文字籤 ---------- */
.cats {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 0 0 8px; margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: 0 0 auto; padding: 10px 14px;
  color: var(--muted); font-size: 1rem; text-decoration: none;
  letter-spacing: .15em; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .25s ease, border-color .25s ease;
}
.cat-btn.on { color: var(--ink); border-bottom-color: var(--celadon-deep); font-weight: 700; }

/* ---------- 商品：冊頁框景 ---------- */
.products {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px 20px;
  padding-bottom: 64px;
}
.product-card {
  text-decoration: none; color: inherit; display: block;
}
.product-img {
  aspect-ratio: 1/1; background: var(--card);
  padding: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #B4A582;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s ease;
}
.product-card:hover .product-img { border-color: var(--celadon); }
.product-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.product-body { padding: 15px 2px 0; text-align: center; }
.product-body h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; letter-spacing: .12em; }
.product-body .summary { margin: 0 0 10px; color: var(--muted); font-size: .92rem; line-height: 1.8; }
.price { color: var(--gold); font-weight: 700; font-size: 1.15rem; letter-spacing: .05em; }
.soldout-tag {
  display: inline-block; border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--radius); padding: 4px 12px; font-size: .9rem; letter-spacing: .2em;
}

/* ---------- 表單 ---------- */
.field { margin-bottom: 26px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 1rem; letter-spacing: .12em; }
.field input[type=text], .field input[type=tel], .field input[type=email],
.field input[type=password], .field input[type=number], .field input[type=date],
.field select, .field textarea {
  width: 100%; padding: 15px 14px; font-size: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--celadon-deep); outline: none;
}
.hint { color: var(--muted); font-size: .92rem; margin-top: 6px; }

/* ---------- 會員表單（登入／註冊）：雙線框景 ---------- */
.auth-wrap { max-width: 560px; margin: 0 auto; }
.auth-sub { text-align: center; color: var(--muted); font-size: .95rem; letter-spacing: .1em; margin: -8px 0 8px; }
.auth-card {
  background: var(--card); border: 1px solid var(--line);
  outline: 1px solid var(--line); outline-offset: 4px;
  border-radius: var(--radius); padding: 38px 34px; margin: 20px 0 12px;
}
.auth-card .field { margin-bottom: 24px; }
.auth-card .field:last-of-type { margin-bottom: 8px; }
.auth-card .field label {
  display: block; font-size: .82rem; font-weight: 700; letter-spacing: .22em;
  color: var(--ink-soft); margin-bottom: 10px;
}
.auth-card .field input[type=text], .auth-card .field input[type=tel],
.auth-card .field input[type=email], .auth-card .field input[type=password],
.auth-card .field select {
  width: 100%; padding: 16px; font-size: 1.05rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #FFFDF8; color: var(--ink);
  transition: border-color .2s ease;
}
.auth-card .field input:focus, .auth-card .field select:focus {
  border-color: var(--celadon-deep); outline: none;
}
.auth-card .field input[readonly] { background: var(--bg); color: var(--ink-soft); }
.auth-card .field .hint { font-size: .85rem; }
.auth-section {
  font-size: .85rem; font-weight: 700; letter-spacing: .32em; text-indent: .32em;
  color: var(--gold); border-bottom: 1px solid var(--line);
  padding-bottom: 14px; margin: 36px 0 26px;
}
.auth-section:first-child { margin-top: 4px; }
.form-errors {
  background: #F9EDEA; border: 1px solid #E2C0B4; border-radius: var(--radius);
  padding: 14px 20px; margin: 0 0 26px; color: var(--danger); font-size: .93rem;
}
.form-errors p { margin: 6px 0; }
.auth-foot { text-align: center; color: var(--muted); font-size: .95rem; margin: 18px 0 8px; }
.auth-foot a { color: var(--celadon-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) {
  .auth-card { padding: 30px 22px; }
}
.err { color: var(--danger); font-weight: 700; margin: 8px 0; }
.ok { color: var(--celadon-deep); font-weight: 700; margin: 8px 0; }

/* ---------- 按鈕：實心青瓷 ---------- */
.btn {
  display: block; width: 100%; padding: 17px; font-size: 1.2rem; font-weight: 700;
  letter-spacing: .25em; text-indent: .25em;
  border: none; border-radius: var(--radius); cursor: pointer; text-align: center;
  text-decoration: none; margin: 14px 0; font-family: inherit;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn-primary { background: var(--celadon); color: var(--card); }
.btn-primary:hover { background: var(--celadon-deep); }
.btn-primary:active { background: var(--celadon-deep); }
.btn-accent { background: var(--cinnabar); color: var(--card); }
.btn-accent:active { background: #8C3325; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--celadon-deep); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { margin: 14px 0; }

/* 付款方式大按鈕 */
.pay-methods { display: grid; gap: 14px; }
.pay-method, .invoice-type {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 20px; font-size: 1.15rem; font-weight: 700; text-align: left;
  letter-spacing: .1em;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer;
  font-family: inherit; color: inherit;
  transition: border-color .25s ease;
}
.pay-method.on, .invoice-type.on { border: 2px solid var(--celadon-deep); padding: 19px; }
.pay-method small, .invoice-type small { display: block; font-weight: 400; font-size: .92rem; color: var(--muted); }

/* ---------- 購物車／訂單 ---------- */
.cart-item {
  display: flex; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; align-items: center;
}
.cart-item .thumb {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: var(--radius);
  background: #EDE5D2; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #B4A582;
}
.cart-item .info { flex: 1; }
.cart-item .info h4 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.qty-ctrl { display: flex; align-items: center; gap: 10px; }
.qty-ctrl button {
  width: 46px; height: 46px; font-size: 1.3rem; border-radius: var(--radius);
  border: 1px solid var(--celadon-deep); background: transparent; color: var(--ink); cursor: pointer;
}
.qty-ctrl span { min-width: 2em; text-align: center; font-size: 1.15rem; font-weight: 700; }

.totals {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin: 20px 0;
}
.totals .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 1.05rem; }
.totals .row.grand {
  font-size: 1.35rem; font-weight: 700; color: var(--gold);
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px;
}

/* 免運進度條 */
.ship-progress {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 16px 0;
}
.ship-progress .bar { height: 6px; background: #E9E0CB; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.ship-progress .bar i { display: block; height: 100%; background: var(--celadon); border-radius: 3px; }

/* 步驟指示 */
.steps { display: flex; margin: 24px 0 32px; }
.steps div {
  flex: 1; text-align: center; padding: 12px 4px; font-size: .95rem;
  letter-spacing: .15em; color: var(--muted); border-bottom: 2px solid var(--line);
}
.steps div.on { color: var(--ink); font-weight: 700; border-color: var(--celadon-deep); }

.flash {
  background: var(--card); border: 1px solid var(--celadon-deep);
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin: 20px 0;
}
.order-no { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: .1em; }

/* ---------- 商品詳情：高質感購買區 ---------- */
.pd-hero { margin: 4px 0 20px; }
.pd-name { font-size: 1.85rem; font-weight: 900; letter-spacing: .08em; margin: 18px 0 10px; line-height: 1.4; }
.pd-summary { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.9; margin: 0; }
.pd-buy {
  background: var(--card); border: 1px solid var(--line);
  outline: 1px solid var(--line); outline-offset: 4px;
  border-radius: var(--radius); padding: 30px 26px; margin: 0 0 28px;
}
.pd-buy.pd-flash { animation: pdFlash 1s ease; }
@keyframes pdFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 4px rgba(126, 150, 138, .35); }
}
.pd-price-row {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.pd-price-label { font-size: .85rem; letter-spacing: .25em; color: var(--gold); white-space: nowrap; }
.pd-price { font-size: 1.9rem; font-weight: 700; color: var(--gold); letter-spacing: .03em; }
.pd-price .hint { font-size: 1.05rem; }
.pd-price .sale-tag { font-size: .8rem; vertical-align: middle; }
.pd-spec-label { font-size: .9rem; color: var(--muted); font-weight: 400; }
.pd-stock { margin: -8px 0 18px; font-size: .95rem; color: var(--muted); }
.pd-stock.urgent {
  color: var(--danger); font-weight: 700;
  background: #F9EDEA; border: 1px solid #E2C0B4; border-radius: var(--radius);
  padding: 10px 16px; display: inline-block;
}
.pd-spec { margin-bottom: 22px; }
.pd-spec label { font-size: .92rem; letter-spacing: .18em; color: var(--ink-soft); }
.pd-qty { margin: 6px 0 20px; }
.pd-bag {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 22px;
}
.pd-bag label { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; cursor: pointer; }
.pd-cta { margin-top: 6px; font-size: 1.3rem; padding: 19px; }
.pd-ship-hint { text-align: center; color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
.pd-trust {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: .88rem; color: var(--ink-soft);
}
/* 區塊標題：置中、兩側漸隱細線 */
.pd-h2, .rp-sec-title {
  display: flex; align-items: center; gap: 20px; justify-content: center;
  text-align: center;
  font-size: 1.25rem; font-weight: 700; letter-spacing: .25em; margin: 38px 0 18px;
}
.pd-h2::before, .pd-h2::after,
.rp-sec-title::before, .rp-sec-title::after {
  content: ""; flex: 1 1 32px; height: 1px;
}
.pd-h2::before, .rp-sec-title::before { background: linear-gradient(90deg, transparent, var(--line)); }
.pd-h2::after, .rp-sec-title::after { background: linear-gradient(90deg, var(--line), transparent); }
.pd-upsell h3 { margin: 0 0 8px; font-size: 1.1rem; }
/* 手機吸底購買列 */
.pd-sticky {
  display: none;
}
@media (max-width: 699px) {
  .pd-sticky {
    display: flex; align-items: center; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(246, 241, 231, .97); border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .pd-sticky-price { flex: 1; font-size: 1.25rem; font-weight: 700; color: var(--gold); }
  .pd-sticky .btn { width: auto; flex: 1.4; margin: 0; padding: 15px 10px; font-size: 1.1rem; }
  body:has(.pd-sticky) { padding-bottom: 78px; }
}

/* 商品圖片畫廊 */
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pd-thumb {
  width: 72px; height: 72px; padding: 0; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb.on { border-color: var(--celadon-deep); }

/* 商品詳情主圖：冊頁框景 */
.detail-img {
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  padding: 10px;
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: #B4A582; margin: 16px 0 32px;
}
.detail-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 2px; }
.spec-opts { display: flex; gap: 12px; flex-wrap: wrap; }
.spec-opt {
  padding: 14px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-size: 1.1rem; cursor: pointer; font-family: inherit;
  letter-spacing: .1em; color: var(--ink);
  touch-action: manipulation; /* 避免 iOS 點按延遲／縮放干擾 */
}
/* 選中狀態：青瓷外框（box-shadow 做框線不佔版面空間、避免點按位移） */
.spec-opt.on { border-color: var(--celadon-deep); box-shadow: 0 0 0 2px var(--celadon-deep); background: #EDF0E9; }
.spec-opt.soldout::after { content: '（售完）'; opacity: .8; }
.spec-opt:disabled { opacity: .4; cursor: not-allowed; }

/* 頁尾：深墨綠冊頁跋文 */
.site-footer {
  margin-top: 72px; padding: 46px 0;
  background: #2E3B33; border-top: 4px double var(--gold);
  color: #E7DFC9;
  text-align: center; font-size: .92rem; letter-spacing: .15em;
}
.site-footer .tiny { font-size: .8rem; color: #A79F87; }

/* 手機：頁尾改為直式排列，避免分隔線斷在行首 */
@media (max-width: 699px) {
  .site-footer { letter-spacing: .06em; padding: 34px 0; }
  .site-footer .f-item { display: block; margin: 6px 0; }
  .site-footer .f-sep { display: none; }
}

/* 桌機 */
@media (min-width: 700px) {
  .products { grid-template-columns: 1fr 1fr 1fr; gap: 44px 28px; }
  .wrap { max-width: 960px; }
  .hero h1 { font-size: 3.2rem; }
}

/* 商品詳細介紹（富文字） */
.desc-body p { margin: 0 0 1.2em; }
.desc-body p:last-child { margin-bottom: 0; }
.desc-body ul, .desc-body ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.desc-body h3, .desc-body h4 { margin: 1.4em 0 .8em; font-weight: 700; letter-spacing: .15em; }
.desc-body blockquote { margin: 0 0 1.2em; padding-left: 1em; border-left: 2px solid var(--celadon); color: var(--ink-soft); }
.desc-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.desc-body a { color: var(--celadon-deep); }

/* 社群分享 */
.share-box h3 { font-size: 1.1rem; letter-spacing: .2em; }
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.share-btn {
  flex: 1 1 0; min-width: 100px; padding: 14px 8px; text-align: center;
  font-size: 1rem; letter-spacing: .1em; text-decoration: none;
  color: var(--ink); background: transparent; border: 1px solid var(--celadon-deep);
  border-radius: var(--radius); cursor: pointer; font-family: inherit;
}
.share-btn:active { background: #EDF0E9; }

/* 特價商品區 */
.sale-section { margin: 38px 0; }
.sale-title {
  display: flex; align-items: center; gap: 20px; justify-content: center;
  text-align: center;
  font-size: 1.35rem; font-weight: 700; letter-spacing: .3em; margin: 0 0 20px;
}
.sale-title::before, .sale-title::after { content: ""; flex: 1 1 40px; height: 1px; }
.sale-title::before { background: linear-gradient(90deg, transparent, var(--line)); }
.sale-title::after { background: linear-gradient(90deg, var(--line), transparent); }
.product-img { position: relative; }
/* 特價徽章：朱砂方印（微旋、字距歸零、內白線） */
.sale-tag {
  position: absolute; top: 10px; left: 10px;
  display: inline-block; background: var(--cinnabar); color: var(--card);
  border-radius: 2px; padding: 5px 9px;
  font-size: .88rem; font-weight: 700; letter-spacing: 0;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 1.5px rgba(253, 251, 246, .45);
}
.orig-price { color: var(--muted); font-size: .95rem; margin-right: 8px; }

/* 特價跑馬燈（無縫輪播） */
.sale-track-wrap { position: relative; }
.sale-track { overflow: hidden; padding: 6px 2px 14px; }
.sale-marquee { display: flex; width: max-content; animation: saleScroll linear infinite; }
.sale-marquee.is-static { animation: none; }
.sale-marquee .sale-card { flex: 0 0 clamp(210px, 62vw, 260px); margin-right: 16px; }
@keyframes saleScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sale-marquee { animation: none; } }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; margin-top: 8px; }
.price-row .orig-price { margin-right: 0; white-space: nowrap; }
.price-row .price { white-space: nowrap; }

/* 特價彈窗（由上掉落・一天一次）：紙色底、雙線框 */
.sale-pop { position: fixed; inset: 0; z-index: 200; }
.sale-pop[hidden] { display: none; }
.sale-pop-backdrop { position: absolute; inset: 0; background: rgba(24, 28, 24, .62); opacity: 0; transition: opacity .3s ease; }
.sale-pop.show .sale-pop-backdrop { opacity: 1; }
.sale-pop-card {
  position: absolute; left: 50%; top: 50%; width: min(92vw, 430px);
  transform: translate(-50%, -185%);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px;
  outline: 1px solid var(--line); outline-offset: 4px;
  padding: 26px 22px 16px; max-height: 84vh; overflow-y: auto;
}
.sale-pop.show .sale-pop-card { animation: saleDrop .7s cubic-bezier(.25, .9, .35, 1) forwards; }
@keyframes saleDrop {
  0% { transform: translate(-50%, -185%); }
  55% { transform: translate(-50%, -42%); }
  75% { transform: translate(-50%, -54%); }
  100% { transform: translate(-50%, -50%); }
}
.sale-pop-x {
  position: absolute; top: 8px; right: 10px; width: 44px; height: 44px;
  border: none; background: transparent; color: var(--muted);
  font-size: 1.7rem; line-height: 1; cursor: pointer; border-radius: 50%;
}
.sale-pop-title { font-size: 1.25rem; letter-spacing: .2em; margin: 0 26px 6px 0; font-weight: 900; text-align: center; }
.sale-pop-timer { text-align: center; font-weight: 700; letter-spacing: .08em; margin: 4px 0 2px; color: var(--cinnabar); font-size: .95rem; }
.sale-pop-count { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 900; }
.sale-pop-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.sale-pop-item img { width: 64px; height: 64px; flex: 0 0 64px; object-fit: cover; border-radius: 2px; }
.sale-pop-item--one { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
.sale-pop-item--one img { width: 100%; height: auto; max-height: 240px; flex: none; object-fit: cover; border-radius: 2px; }
.sale-pop-item--one .sale-pop-info { align-items: center; }
.sale-pop-item--one .price-row { justify-content: center; }
.sale-pop-item--one .sale-pop-name { font-size: 1.12rem; }
.sale-pop-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sale-pop-name { font-weight: 700; font-size: 1.02rem; }
.sale-pop-item .price-row { margin-top: 0; }
.sale-pop-item .price { font-size: 1.05rem; }


/* ---------- ATM 轉帳回報 ---------- */
.rp-wrap { max-width: 620px; margin: 0 auto; padding: 12px 0 8px; }
.rp-kicker { text-align: center; letter-spacing: .45em; text-indent: .45em; color: var(--gold); font-weight: 700; font-size: .92rem; margin: 6px 0 6px; }
.rp-title { text-align: center; font-size: 1.65rem; letter-spacing: .12em; margin: 0 0 22px; font-weight: 900; }
.rp-steps { display: flex; list-style: none; padding: 0; margin: 0 0 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rp-steps li { flex: 1; text-align: center; padding: 13px 4px; color: var(--muted); font-size: .92rem; letter-spacing: .12em; }
.rp-steps li + li { border-left: 1px solid var(--line); }
.rp-steps .n { display: inline-block; width: 1.7em; height: 1.7em; line-height: 1.7em; text-align: center; border: 1px solid var(--line); border-radius: 50%; margin-right: 8px; font-size: .82em; }
.rp-steps li.done .n { background: var(--celadon-deep); border-color: var(--celadon-deep); color: var(--paper); }
.rp-steps li.now { color: var(--ink); font-weight: 700; }
.rp-steps li.now .n { border-color: var(--celadon-deep); }
.rp-panel { border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 3px; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 30px; background: var(--card); }
.rp-panel h2 { font-size: 1rem; letter-spacing: .3em; margin: 0 0 8px; }
.rp-note { white-space: pre-line; margin: 6px 0 0; line-height: 2; }
.rp-dl { margin: 0; }
.rp-dl > div { display: flex; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.rp-dl > div:first-child { border-top: none; }
.rp-dl dt { width: 4.5em; flex-shrink: 0; color: var(--muted); letter-spacing: .25em; font-size: .9rem; }
.rp-dl dd { margin: 0; font-size: 1.12rem; }
.rp-dl dd.acct { font-size: 1.4rem; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.rp-order { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; text-align: center; letter-spacing: .06em; }
.rp-order strong { color: var(--ink); }
.rp-order .sep { margin: 0 10px; }
.rp-privacy { color: var(--muted); font-size: .9rem; margin-top: 14px; letter-spacing: .04em; }
.rp-done { text-align: center; padding: 26px 12px 30px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.rp-done .tick { display: inline-flex; width: 54px; height: 54px; border-radius: 50%; background: var(--celadon-deep); color: var(--paper); align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 12px; }
.rp-done h2 { font-size: 1.25rem; letter-spacing: .1em; margin: 0 0 8px; }
.rp-done p { margin: 4px 0; }
.req { color: var(--danger); }
input.acct5 { letter-spacing: .4em; font-size: 1.45rem !important; font-variant-numeric: tabular-nums; }

/* 商品圖淡入淡出輪播（inset 保留冊頁框景的紙邊） */
.pd-main-img { position: relative; }
.pd-slide { position: absolute; inset: 10px; opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.detail-img img.pd-slide { width: calc(100% - 20px); height: calc(100% - 20px); max-width: none; object-fit: contain; }
.pd-slide.on { opacity: 1; }

/* 特價輪播：滑鼠停留／手指按住暫停 */
.sale-marquee.paused, .sale-track-wrap:hover .sale-marquee { animation-play-state: paused; }

/* ---------- 累計到訪人次（編輯式計數器） ---------- */
.visit-counter {
  margin: 0 0 44px; display: flex; flex-direction: column; gap: 14px;
  max-width: 100%; padding: 24px 30px 20px 2px; position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.visit-counter::before {
  content: ""; position: absolute; top: -1px; left: 0; width: 56px; height: 2px;
  background: var(--gold);
}
.visit-counter::after {
  content: ""; position: absolute; top: 3px; left: 0; right: 0; height: 1px;
  background: var(--line);
}
.vc-label {
  font-size: .78rem; letter-spacing: .42em; color: var(--celadon-deep);
}
.vc-digits { display: flex; gap: .12em; max-width: 100%; }
.vc-digit {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: 2.5rem; font-weight: 500; line-height: 1.05;
  font-variant-numeric: tabular-nums; color: var(--ink); text-align: center;
}
.vc-digit.dim { color: rgba(46, 44, 38, .25); }
@media (max-width: 700px) {
  .visit-counter { margin-bottom: 34px; padding: 18px 10px 16px 2px; gap: 11px; }
  .vc-label { letter-spacing: .32em; }
  .vc-digit { font-size: 1.85rem; }
}

/* 購買區信任列排版修正（2026-10-22 使用者截圖回報）：避免手機 2+1 掉行不齊，改直向三列置中 */
.pd-trust span { white-space: nowrap; }
@media (max-width: 700px) {
  .pd-trust { flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; }
  .pd-bag .qty-ctrl { flex-wrap: wrap; row-gap: 8px; }
}
