/* ============================================================
   比比昂 Bibian — App 版設計稿共用殼（public/app/ 全部頁面共用）
   相依：../tokens.css（語意 token）、../site.css（借 .tile 剪影與 .gbar）
   合約：docs/spec-app-2026-09-04.md §3。這裡只放跨頁共用的東西；
   單頁版面寫在該頁 <style>，前綴 au-／bu-／ac-。

   風格：Airbnb 主體（白底、圖優先、hairline 分隔、圓角 14/20、卡片零陰影、
   sheet 三層疊陰影、正文字重 500）＋ 金融風局部（金額大字 tabular、兩段分色卡、
   深底餘額卡）。顏色只用 --bb-* 語意 token；本檔另定義 --a-* 尺寸與陰影。
   ============================================================ */
@import url("../tokens.css");
@import url("../site.css");

:root {
  --a-w: 430px;
  --a-hd: 56px;
  --a-tab: 64px;
  --a-r-card: 14px;
  --a-r-sheet: 20px;
  --a-r-pill: 999px;
  --a-touch: 44px;
  --a-gap: 16px;
  --a-hair: 1px solid var(--bb-border);
  /* Airbnb 式三層疊陰影：sheet／浮起面板才用，卡片零陰影 */
  --a-shadow-sheet: 0 0 0 1px var(--bb-scrim-weak), 0 2px 6px var(--bb-scrim-weak), 0 -8px 24px var(--bb-scrim);
  --a-shadow-float: 0 4px 12px var(--bb-scrim-weak);
  --a-num: "tnum" 1;
  /* tokens.css 沒有 success-soft；這裡用 color-mix 從語意色調出來，不寫裸色碼 */
  --a-success-soft: color-mix(in srgb, var(--bb-success) 14%, transparent);
}

[hidden] { display: none !important; }   /* site.css 學過的：元件的 display 會蓋掉 hidden 屬性 */

/* ---------- 外框：手機框置中，旁邊放差異說明 ---------- */
.a-body { margin: 0; background: var(--bb-surface-sunken); color: var(--bb-text);
  font-family: var(--bb-font-sans); font-size: var(--bb-text-md); line-height: var(--bb-leading-normal);
  font-weight: var(--bb-weight-medium); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 0 0 48px; }
.a-app { position: relative; width: min(var(--a-w), 100vw); min-height: 100dvh; background: var(--bb-surface);
  display: flex; flex-direction: column; }
.a-main { flex: 1; padding: 0 0 calc(var(--a-tab) + 16px); }
.a-main--flush { padding-top: 0; }
@media (min-width: 900px) {
  .a-body { flex-direction: row; align-items: flex-start; justify-content: center; padding: 32px 24px 64px; }
  .a-app { min-height: 860px; border-radius: 36px; box-shadow: 0 0 0 1px var(--bb-border-strong), var(--a-shadow-float);
    overflow: hidden; }
  .a-note { position: sticky; top: 32px; width: 360px; }
}

/* 差異說明（每頁必有，給 IT 看） */
.a-note { width: min(var(--a-w), 100vw); padding: 20px; background: var(--bb-surface);
  border: var(--a-hair); border-radius: var(--a-r-card); font-size: var(--bb-text-sm); }
.a-note h2 { font-size: var(--bb-text-md); font-weight: var(--bb-weight-bold); margin-bottom: 8px; }
.a-note dl { margin: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 10px; }
.a-note dt { color: var(--bb-text-muted); font-weight: var(--bb-weight-bold); }
.a-note dd { margin: 0; }
.a-note dl + dl { margin-top: 14px; padding-top: 14px; border-top: var(--a-hair); }
.a-note a { color: var(--bb-brand-ink); text-decoration: underline; }

/* ---------- icon ---------- */
.a-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
.a-ic--sm { width: 16px; height: 16px; }
.a-ic--lg { width: 28px; height: 28px; }

/* ---------- Header ---------- */
.a-hd { position: sticky; top: 0; z-index: var(--bb-z-sticky); height: var(--a-hd);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px;
  background: var(--bb-surface); border-bottom: var(--a-hair); }
.a-hd__btn { width: var(--a-touch); height: var(--a-touch); display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 50%; color: var(--bb-text); position: relative;
  cursor: pointer; }
.a-hd__btn:active { background: var(--bb-surface-sunken); }
.a-hd__dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bb-hot); box-shadow: 0 0 0 2px var(--bb-surface); }
.a-hd__title { flex: 1; min-width: 0; font-size: var(--bb-text-lg); font-weight: var(--bb-weight-bold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-hd__logo { display: flex; align-items: center; gap: 8px; height: var(--a-touch); padding-right: 4px; }
.a-hd__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--bb-brand);
  display: grid; place-items: center; color: var(--bb-text-on-brand); font-weight: var(--bb-weight-bold);
  font-size: 15px; }
.a-hd__brand { font-weight: var(--bb-weight-bold); font-size: var(--bb-text-md); letter-spacing: .02em; }
.a-hd__spacer { flex: 1; }
/* 館別切換：logo 旁的 pill，點開 sheet 換館，tab 跟著換 */
.a-hall { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px 0 12px;
  border: var(--a-hair); border-radius: var(--a-r-pill); background: var(--bb-surface);
  font-size: var(--bb-text-sm); font-weight: var(--bb-weight-bold); color: var(--bb-text); cursor: pointer; }
.a-hall .a-ic { width: 14px; height: 14px; }
.a-hall__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bb-ch-auction); }
[data-hall="buy"] .a-hall__dot { background: var(--bb-ch-buy); }
/* header 搜尋框 */
.a-hd__search { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border: var(--a-hair); border-radius: var(--a-r-pill); background: var(--bb-surface-sunken);
  color: var(--bb-text-muted); font-size: var(--bb-text-base); }
.a-hd__search b { color: var(--bb-text); font-weight: var(--bb-weight-medium); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* ---------- 搜尋列（首頁） ---------- */
.a-search { margin: 12px var(--a-gap) 0; height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 16px; border: var(--a-hair); border-radius: var(--a-r-pill); background: var(--bb-surface);
  box-shadow: var(--a-shadow-float); }
.a-search__in { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--bb-text);
  height: 100%; outline: none; }
.a-search__in::placeholder { color: var(--bb-text-muted); }
.a-search__dict { height: 40px; padding: 0 12px; border: 0; border-radius: var(--a-r-pill);
  background: var(--bb-brand-soft); color: var(--bb-brand-ink); font: inherit; font-size: var(--bb-text-sm);
  font-weight: var(--bb-weight-bold); white-space: nowrap; cursor: pointer; }
.a-search__go { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bb-brand);
  color: var(--bb-text-on-brand); display: grid; place-items: center; cursor: pointer; }

/* ---------- 底部 tab ---------- */
.a-tab { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--a-w), 100vw);
  height: var(--a-tab); z-index: var(--bb-z-nav); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--bb-surface); border-top: var(--a-hair); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 900px) {
  /* 桌機上手機框是置中的圓角框，tab 要貼在框底而不是視窗底 */
  .a-app { padding-bottom: 0; }
  .a-tab { position: absolute; left: 0; transform: none; width: 100%; }
}
.a-tab a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--a-touch); color: var(--bb-text-muted); font-size: 11px; font-weight: var(--bb-weight-bold);
  text-decoration: none; position: relative; }
.a-tab a[aria-current="page"] { color: var(--bb-text); }
.a-tab a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 2px;
  background: var(--bb-brand); border-radius: 0 0 2px 2px; }
.a-tab .a-badge { position: absolute; top: 8px; left: calc(50% + 6px); }

/* ---------- 通用小件 ---------- */
.a-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bb-hot);
  color: var(--bb-text-on-hot); font-size: 11px; font-weight: var(--bb-weight-bold); display: inline-grid;
  place-items: center; font-variant-numeric: tabular-nums; }
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px;
  padding: 0 20px; border-radius: var(--a-r-pill); border: 1px solid transparent; font: inherit;
  font-weight: var(--bb-weight-bold); font-size: var(--bb-text-md); cursor: pointer; text-decoration: none;
  transition: var(--bb-transition-fast); }
.a-btn:active { transform: scale(.97); }
.a-btn--brand { background: var(--bb-brand); color: var(--bb-text-on-brand); }
.a-btn--hot { background: var(--bb-hot); color: var(--bb-text-on-hot); }
.a-btn--ink { background: var(--bb-bar); color: var(--bb-bar-text); }
.a-btn--ghost { background: var(--bb-surface); color: var(--bb-text); border-color: var(--bb-border-strong); }
.a-btn--soft { background: var(--bb-surface-sunken); color: var(--bb-text); }
.a-btn--sm { height: 36px; padding: 0 14px; font-size: var(--bb-text-sm); }
.a-btn--block { width: 100%; }
.a-btn[disabled] { opacity: .45; pointer-events: none; }
.a-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--a-gap); scrollbar-width: none;
  -webkit-overflow-scrolling: touch; }
.a-chips::-webkit-scrollbar { display: none; }
/* 高度 44：2026-09-10 收回共用層。原本 36px，四頁各自寫 `.xxx .a-chip { min-height: var(--a-touch) }`
   把它撐到 44（brands／guarantee／ticket／help），buy-detail 又自己寫 40——同一個元件四種高度。
   chip 不在 spec R6 的清單裡，但既然多數頁都想要 44，就一次定在這裡，頁面不要再覆寫。 */
.a-chip { flex: none; height: var(--a-touch); padding: 0 14px; border-radius: var(--a-r-pill); border: var(--a-hair);
  background: var(--bb-surface); color: var(--bb-text); font: inherit; font-size: var(--bb-text-sm);
  font-weight: var(--bb-weight-bold); white-space: nowrap; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; text-decoration: none; }
.a-chip[aria-pressed="true"], .a-chip.is-on { background: var(--bb-text); color: var(--bb-surface);
  border-color: var(--bb-text); }
.a-chip--brand { background: var(--bb-brand-soft); color: var(--bb-brand-ink); border-color: transparent; }
.a-chip[disabled] { opacity: .4; text-decoration: line-through; }

/* 區塊 */
.a-section { padding: 24px var(--a-gap) 0; }
.a-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; }
.a-section__head h2 { font-size: var(--bb-text-xl); font-weight: var(--bb-weight-bold); line-height: 1.2; }
.a-section__head p { color: var(--bb-text-muted); font-size: var(--bb-text-sm); margin-top: 2px; }
.a-section__more { color: var(--bb-text); font-size: var(--bb-text-sm); font-weight: var(--bb-weight-bold);
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.a-section--flush { padding-inline: 0; }
.a-section--flush .a-section__head { padding-inline: var(--a-gap); }
.a-hr { height: 8px; background: var(--bb-surface-sunken); margin-top: 24px; }

/* 列表列 */
.a-list { border-top: var(--a-hair); }
.a-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px var(--a-gap);
  border-bottom: var(--a-hair); color: var(--bb-text); text-decoration: none; background: transparent;
  width: 100%; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; cursor: pointer; }
.a-row:active { background: var(--bb-surface-sunken); }
.a-row__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--bb-surface-sunken);
  display: grid; place-items: center; color: var(--bb-text); flex: none; }
.a-row__body { flex: 1; min-width: 0; }
.a-row__t { display: block; font-weight: var(--bb-weight-bold); }
.a-row__s { display: block; color: var(--bb-text-muted); font-size: var(--bb-text-sm); margin-top: 2px; }
.a-row__end { color: var(--bb-text-muted); font-size: var(--bb-text-sm); display: flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums; }

/* 頁籤（頁內） */
.a-tabs { display: flex; gap: 0; padding: 0 var(--a-gap); border-bottom: var(--a-hair); overflow-x: auto;
  scrollbar-width: none; }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs button { flex: none; min-width: 72px; height: 48px; padding: 0 12px; border: 0; background: transparent;
  font: inherit; font-weight: var(--bb-weight-bold); color: var(--bb-text-muted); position: relative; cursor: pointer; }
.a-tabs button[aria-selected="true"] { color: var(--bb-text); }
.a-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--bb-text); }
.a-tabs button .a-badge { margin-left: 4px; vertical-align: 1px; }

/* ---------- 商品卡 ---------- */
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 0 var(--a-gap); }
.a-card { display: flex; flex-direction: column; gap: 4px; color: var(--bb-text); text-decoration: none;
  position: relative; min-width: 0; }
.a-card__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--a-r-card); overflow: hidden;
  background: var(--bb-surface-sunken); }
.a-card__media .tile { border-radius: inherit; }
.a-card__flag { position: absolute; top: 10px; left: 10px; height: 24px; padding: 0 8px; border-radius: 8px;
  background: var(--bb-surface); color: var(--bb-text); font-size: 11px; font-weight: var(--bb-weight-bold);
  display: inline-flex; align-items: center; gap: 4px; box-shadow: var(--a-shadow-float); }
.a-card__flag--hot { background: var(--bb-hot); color: var(--bb-text-on-hot); }
.a-card__flag--brand { background: var(--bb-brand); color: var(--bb-text-on-brand); }
.a-card__watch { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0;
  background: transparent; color: var(--bb-surface); display: grid; place-items: center; cursor: pointer;
  filter: drop-shadow(0 1px 2px var(--bb-scrim-strong)); }
.a-card__watch .a-ic { width: 24px; height: 24px; stroke-width: 2; }
.a-card__watch.is-on { color: var(--bb-hot); }
.a-card__watch.is-on .a-ic { fill: var(--bb-hot); }
.a-card__title { margin-top: 6px; font-size: var(--bb-text-base); font-weight: var(--bb-weight-bold);
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-card__ja { font-size: 11px; color: var(--bb-text-faint); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.a-card__price { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.a-card__jpy { font-size: var(--bb-text-md); font-weight: var(--bb-weight-bold); }
.a-card__twd { font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.a-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-variant-numeric: tabular-nums; }
.a-card__left { display: inline-flex; align-items: center; gap: 3px; }
.a-card__left.is-hot { color: var(--bb-hot); font-weight: var(--bb-weight-bold); }
.a-card__site { color: var(--bb-text); font-weight: var(--bb-weight-bold); }
.a-card__stock--low { color: var(--bb-hot); }
.a-card--done .a-card__media { opacity: .55; }
.a-card--done .a-card__jpy { color: var(--bb-text-muted); }
/* 列表型 */
.a-card--row { flex-direction: row; gap: 12px; padding: 12px var(--a-gap); border-bottom: var(--a-hair); }
.a-card--row .a-card__media { width: 96px; aspect-ratio: 1; flex: none; border-radius: 12px; }
.a-card--row .a-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.a-card--row .a-card__title { margin-top: 0; }
.a-card--row .a-card__watch { top: 2px; right: 2px; width: 32px; height: 32px; }
.a-card--row .a-card__foot { margin-top: auto; }
/* 橫捲卡列 */
.a-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 var(--a-gap) 4px; scrollbar-width: none; }
.a-scroll::-webkit-scrollbar { display: none; }
.a-scroll .a-card { flex: none; width: 160px; }

/* 一円起標排行列 */
.a-rank { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px var(--a-gap);
  color: var(--bb-text); text-decoration: none; border-bottom: var(--a-hair); }
.a-rank__n { width: 22px; font-size: var(--bb-text-lg); font-weight: var(--bb-weight-bold);
  color: var(--bb-text-faint); font-variant-numeric: tabular-nums; text-align: center; }
.a-rank:nth-child(-n+3) .a-rank__n { color: var(--bb-brand-ink); }
.a-rank__media { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; position: relative; flex: none; }
.a-rank__body { flex: 1; min-width: 0; }
.a-rank__t { font-weight: var(--bb-weight-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-rank__s { font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-variant-numeric: tabular-nums;
  display: flex; gap: 8px; margin-top: 2px; }

/* ---------- 輪播 banner（文字不進 peek 區） ---------- */
.a-banner { margin-top: 16px; }
.a-banner__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--a-gap); scrollbar-width: none; }
.a-banner__track::-webkit-scrollbar { display: none; }
.a-banner__slide { flex: none; width: calc(100% - 24px); aspect-ratio: 16 / 8; border-radius: var(--a-r-card);
  scroll-snap-align: start; position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 16px; color: var(--bb-text); text-decoration: none;
  background: linear-gradient(135deg, var(--bb-brand-soft), var(--bb-surface-sunken)); }
.a-banner__slide--ink { background: linear-gradient(135deg, var(--bb-bar), var(--bb-bar-border)); color: var(--bb-bar-text); }
.a-banner__slide--hot { background: linear-gradient(135deg, var(--bb-hot-soft), var(--bb-brand-soft)); }
.a-banner__k { font-size: 11px; font-weight: var(--bb-weight-bold); letter-spacing: var(--bb-tracking-caps);
  opacity: .75; }
.a-banner__t { font-size: var(--bb-text-xl); font-weight: var(--bb-weight-bold); line-height: 1.2; margin-top: 2px; padding-left: 8px; }
.a-banner__k, .a-banner__s { padding-left: 8px; }
.a-banner__s { font-size: var(--bb-text-sm); margin-top: 4px; opacity: .8; }
.a-banner__art { position: absolute; right: 12px; top: 12px; width: 34%; height: 76%; border-radius: 10px;
  overflow: hidden; }
.a-banner__dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.a-banner__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--bb-border-strong); }
.a-banner__dots i.is-on { width: 18px; border-radius: 3px; background: var(--bb-text); }

/* ---------- 四步／五大保證 ---------- */
.a-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0 var(--a-gap); }
.a-steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.a-step { text-align: center; font-size: var(--bb-text-xs); color: var(--bb-text-muted); position: relative; }
.a-step__ic { width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 50%; background: var(--bb-surface-sunken);
  display: grid; place-items: center; color: var(--bb-text); }
.a-step b { display: block; color: var(--bb-text); font-size: var(--bb-text-sm); }
.a-step + .a-step::before { content: ""; position: absolute; left: -3px; top: 22px; width: 6px; height: 1px;
  background: var(--bb-border-strong); }
.a-guar { display: grid; gap: 0; padding: 0 var(--a-gap); border-top: var(--a-hair); }
.a-guar a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0;
  border-bottom: var(--a-hair); color: var(--bb-text); text-decoration: none; }
.a-guar__n { width: 28px; height: 28px; border-radius: 50%; background: var(--bb-brand-soft);
  color: var(--bb-brand-ink); display: grid; place-items: center; font-weight: var(--bb-weight-bold);
  font-size: var(--bb-text-sm); flex: none; }
.a-guar b { display: block; font-size: var(--bb-text-base); }
.a-guar span span { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }

/* ---------- 狀態膠囊 ---------- */
.a-state { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: var(--bb-weight-bold); background: var(--bb-surface-sunken); color: var(--bb-text);
  white-space: nowrap; }
.a-state--live { background: var(--bb-brand-soft); color: var(--bb-brand-ink); }
.a-state--lead, .a-state--won, .a-state--done { background: var(--a-success-soft); color: var(--bb-success-ink); }
.a-state--outbid, .a-state--lost, .a-state--pay1, .a-state--pay2 { background: var(--bb-hot-soft); color: var(--bb-hot); }
.a-state--ended, .a-state--unsold { background: var(--bb-surface-sunken); color: var(--bb-text-muted); }
.a-state--jp, .a-state--ship { background: var(--bb-info-soft); color: var(--bb-info); }

/* ---------- 金融風：金額、費用卡、錢包 ---------- */
.a-amt { font-variant-numeric: tabular-nums; font-weight: var(--bb-weight-bold); letter-spacing: -.01em; line-height: 1; }
.a-amt--xl { font-size: 34px; }
.a-amt--lg { font-size: 28px; }
.a-amt--md { font-size: 22px; }
.a-amt small { font-size: .5em; font-weight: var(--bb-weight-bold); margin-right: 3px; vertical-align: .18em;
  color: var(--bb-text-muted); }
.a-amt--on-dark small { color: var(--bb-bar-muted); }

.a-fee { display: grid; gap: 12px; padding: 0 var(--a-gap); }
.a-fee__stage { border-radius: var(--a-r-card); padding: 14px 16px; border: var(--a-hair); background: var(--bb-surface); }
.a-fee__stage--1 { background: var(--bb-brand-soft); border-color: transparent; }
.a-fee__stage--2 { background: var(--bb-surface-sunken); border-color: transparent; }
.a-fee__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.a-fee__head b { font-size: var(--bb-text-base); display: block; }
.a-fee__head span { font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.a-fee__rows { margin-top: 10px; display: grid; gap: 6px; font-size: var(--bb-text-sm); font-variant-numeric: tabular-nums; }
.a-fee__row { display: flex; justify-content: space-between; gap: 12px; }
.a-fee__row span:first-child { color: var(--bb-text-muted); min-width: 0; }
.a-fee__row--sub { padding-top: 6px; border-top: 1px dashed var(--bb-border-strong); font-weight: var(--bb-weight-bold); }
.a-fee__row--sub span:first-child { color: var(--bb-text); }
.a-fee__group { margin-top: 8px; font-size: 11px; font-weight: var(--bb-weight-bold); letter-spacing: var(--bb-tracking-caps);
  color: var(--bb-text-muted); }
.a-fee__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.a-fee__total span { color: var(--bb-text-muted); font-size: var(--bb-text-sm); }
.a-fee__note { padding: 0 4px; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }

.a-wallet { margin: 0 var(--a-gap); padding: 18px 18px 16px; border-radius: var(--a-r-card); background: var(--bb-bar);
  color: var(--bb-bar-text); display: grid; gap: 14px; }
.a-wallet__k { font-size: var(--bb-text-xs); color: var(--bb-bar-muted); font-weight: var(--bb-weight-bold);
  letter-spacing: var(--bb-tracking-caps); }
.a-wallet__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.a-wallet__credit { text-align: right; font-size: var(--bb-text-sm); color: var(--bb-bar-muted); }
.a-wallet__credit b { display: block; color: var(--bb-bar-text); font-size: var(--bb-text-md); font-variant-numeric: tabular-nums; }
.a-wallet__acts { display: flex; gap: 8px; }
.a-wallet__acts .a-btn { height: 44px; flex: 1; }
.a-wallet__acts .a-btn--brand { color: var(--bb-text-on-brand); }
.a-wallet__acts .a-btn--ghost { background: transparent; color: var(--bb-bar-text); border-color: var(--bb-bar-border); }

/* ---------- Bottom sheet ---------- */
.a-sheet { position: fixed; inset: 0; z-index: var(--bb-z-modal); display: none; }
.a-sheet.is-open { display: block; }
.a-sheet__scrim { position: absolute; inset: 0; background: var(--bb-scrim-strong); }
.a-sheet__panel { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--a-w), 100vw);
  max-height: 88dvh; overflow: auto; background: var(--bb-surface); border-radius: var(--a-r-sheet) var(--a-r-sheet) 0 0;
  box-shadow: var(--a-shadow-sheet); padding: 8px var(--a-gap) calc(16px + env(safe-area-inset-bottom));
  animation: a-up var(--bb-duration) var(--bb-ease-out); }
@media (min-width: 900px) { .a-sheet__panel { bottom: 48px; border-radius: var(--a-r-sheet); max-height: 76vh; } }
@keyframes a-up { from { transform: translate(-50%, 24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .a-sheet__panel { animation: none; } .a-btn:active { transform: none; } }
.a-sheet__grip { width: 36px; height: 4px; border-radius: 2px; background: var(--bb-border-strong); margin: 4px auto 12px; }
.a-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.a-sheet__head h2 { font-size: var(--bb-text-xl); font-weight: var(--bb-weight-bold); }
.a-sheet__close { width: var(--a-touch); height: var(--a-touch); border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center; color: var(--bb-text); cursor: pointer; margin-right: -8px; }
.a-sheet__sub { color: var(--bb-text-muted); font-size: var(--bb-text-sm); }
.a-sheet .a-fee { padding: 0; }
.a-sheet__acts { display: grid; gap: 8px; margin-top: 16px; }
.a-sheet__acts .a-btn { min-height: 48px; }
/* 長按確認：環形進度＋文字 */
.a-hold { position: relative; overflow: hidden; }
.a-hold__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--bb-scrim-weak); transition: width 1s linear; }
.a-hold.is-holding .a-hold__bar { width: 100%; }
.a-hold span { position: relative; }
.a-hold__hint { text-align: center; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
/* 出價金額輸入 */
.a-bidin { display: flex; align-items: baseline; gap: 8px; padding: 10px 0 6px; border-bottom: 2px solid var(--bb-text); }
.a-bidin small { font-size: var(--bb-text-lg); font-weight: var(--bb-weight-bold); color: var(--bb-text-muted); }
.a-bidin input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 34px;
  font-weight: var(--bb-weight-bold); font-variant-numeric: tabular-nums; color: var(--bb-text); outline: none;
  letter-spacing: -.01em; }
.a-bidin__twd { font-size: var(--bb-text-sm); color: var(--bb-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.a-quick { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.a-quick .a-chip { height: 40px; }
.a-sheet .a-chip { min-height: var(--a-touch); }   /* R6：sheet 裡的 chip 也是觸控目標（A 組兩頁各自補過，收回共用） */
.a-opt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.a-opt label { border: var(--a-hair); border-radius: 12px; padding: 12px; cursor: pointer; display: grid; gap: 2px;
  font-size: var(--bb-text-sm); min-height: 60px; }
.a-opt label b { font-size: var(--bb-text-base); }
.a-opt label span { color: var(--bb-text-muted); font-size: var(--bb-text-xs); }
.a-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.a-opt label:has(input:checked) { border-color: var(--bb-text); box-shadow: 0 0 0 1px var(--bb-text); }
.a-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bb-warning-soft);
  color: var(--bb-warning-ink); font-size: var(--bb-text-sm); display: flex; gap: 8px; align-items: flex-start; }

/* ---------- 表單 ---------- */
.a-form { display: grid; gap: 16px; padding: 16px var(--a-gap) 0; }
.a-field label { display: block; font-size: var(--bb-text-sm); font-weight: var(--bb-weight-bold); margin-bottom: 6px; }
.a-field label i { color: var(--bb-hot); font-style: normal; }
.a-field input, .a-field select, .a-field textarea { width: 100%; min-height: 48px; padding: 0 14px; border: var(--a-hair);
  border-radius: 12px; background: var(--bb-surface); font: inherit; color: var(--bb-text); outline: none; }
.a-field textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus { border-color: var(--bb-text); box-shadow: 0 0 0 1px var(--bb-text); }
/* .a-opt 放在 .a-field 裡時，.a-field input 的 width:100%/min-height:48px 會蓋掉 .a-opt input 的
   position:absolute; width:0（同特異度、寫在後面），絕對定位的 radio 被撐成整個 .a-app 寬 → 500px 下橫向溢出 202px。
   2026-09-10 A 組實測到，補這一條把視覺選項卡的隱藏 input 鎖回 0。 */
.a-field .a-opt input, .a-field .a-switch input { width: auto; min-height: 0; padding: 0; }
.a-field .a-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.a-field__help { font-size: var(--bb-text-xs); color: var(--bb-text-muted); margin-top: 6px; }
.a-field__err { font-size: var(--bb-text-xs); color: var(--bb-hot); margin-top: 6px; }
.a-field--check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--bb-text-sm); }
.a-field--check input { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--bb-text); }
.a-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.a-switch input { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--bb-border-strong);
  position: relative; cursor: pointer; margin: 0; }
.a-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bb-surface); transition: var(--bb-transition-fast); }
.a-switch input:checked { background: var(--bb-success); }
.a-switch input:checked::after { left: 23px; }

/* ---------- 空狀態、toast、底欄 ---------- */
.a-empty { text-align: center; padding: 56px 32px; color: var(--bb-text-muted); display: grid; gap: 8px; justify-items: center; }
.a-empty .a-ic { width: 48px; height: 48px; color: var(--bb-border-strong); }
.a-empty b { color: var(--bb-text); font-size: var(--bb-text-md); }
.a-empty .a-btn { margin-top: 8px; }
.a-toast { position: fixed; left: 50%; bottom: calc(var(--a-tab) + 20px); transform: translateX(-50%);
  background: var(--bb-bar); color: var(--bb-bar-text); padding: 10px 16px; border-radius: 10px; font-size: var(--bb-text-sm);
  z-index: var(--bb-z-tooltip); box-shadow: var(--a-shadow-float); max-width: min(360px, 90vw); text-align: center; }
.a-toast[hidden] { display: none; }
/* 商品頁的底欄：貼在 tab 之上 */
.a-cta { position: sticky; bottom: var(--a-tab); z-index: var(--bb-z-raised); display: flex; align-items: center; gap: 10px;
  padding: 10px var(--a-gap) 12px; background: var(--bb-surface); border-top: var(--a-hair); }
.a-cta__price { flex: 1; min-width: 0; }
.a-cta__price > small { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.a-cta .a-btn { min-width: 96px; }
.a-cta--stack { flex-direction: column; align-items: stretch; }

/* ---------- 賣家卡、標籤 ---------- */
.a-seller { margin: 0 var(--a-gap); padding: 12px; border: var(--a-hair); border-radius: var(--a-r-card);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.a-seller__av { width: 40px; height: 40px; border-radius: 50%; background: var(--bb-brand-soft); color: var(--bb-brand-ink);
  display: grid; place-items: center; font-weight: var(--bb-weight-bold); }
.a-seller__name { font-weight: var(--bb-weight-bold); }
.a-seller__meta { font-size: var(--bb-text-xs); color: var(--bb-text-muted); margin-top: 2px; }
.a-seller__ok { font-size: var(--bb-text-xs); color: var(--bb-success-ink); font-weight: var(--bb-weight-bold); }
.a-seller__bad { font-size: var(--bb-text-xs); color: var(--bb-hot); font-weight: var(--bb-weight-bold); }
.a-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--bb-surface-sunken); font-size: 11px; font-weight: var(--bb-weight-bold); color: var(--bb-text-muted); }
.a-tag--brand { background: var(--bb-brand-soft); color: var(--bb-brand-ink); }
.a-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: var(--bb-text-sm);
  padding: 0 var(--a-gap); }
.a-kv dt { color: var(--bb-text-muted); }
.a-kv dd { margin: 0; }
.a-p { padding: 0 var(--a-gap); color: var(--bb-text-muted); font-size: var(--bb-text-sm); }
.a-p b { color: var(--bb-text); }
.a-muted { color: var(--bb-text-muted); }
.a-hot { color: var(--bb-hot); }
.a-num { font-variant-numeric: tabular-nums; }
.a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
