/* ===== 壹倉庫 YISS HUB — 全站樣式（黑白簡潔） ===== */
:root {
  --rose: #3a3a3a;
  --rose-deep: #141414;
  --bg: #ffffff;
  --ink: #141414;
  --ink-2: #717171;
  --gold: #9a9a9a;
  --rose-bg: #f5f5f5;
  --white: #ffffff;
  --line: #eaeaea;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 16px 38px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", "Noto Sans TC", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: "Songti TC", "SimSun", "Noto Serif TC", serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ===== 頁面容器（移動端 max-width 480 居中） ===== */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 18px 48px;
  animation: fadeUp 0.7s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 頂部導覽 ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(0, 0, 0, 0.04);
}
.header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Songti TC", "SimSun", "Noto Serif TC", serif; font-size: 1.15rem; letter-spacing: 1.5px; color: var(--ink); }
.brand .logo-svg { width: 40px; height: 40px; flex: none; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.14); }
.brand .capital { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { display: block; font-family: "PingFang TC", "Segoe UI", sans-serif; font-size: 0.62rem; letter-spacing: 3px; color: var(--gold); font-weight: 600; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav-link { display: inline-flex; align-items: center; font-size: 0.9rem; color: var(--ink-2); transition: color 0.25s var(--ease); }
.nav-link .nav-ic { width: 22px; height: 22px; display: block; }
.nav-link:hover { color: var(--rose-deep); }
.nav-link.active { color: var(--rose-deep); font-weight: 600; }

/* 購物車徽章 */
.cart-badge { position: relative; display: inline-flex; }
.cart-badge .count {
  position: absolute; top: -6px; right: -8px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 10px; background: var(--rose-deep); color: #fff;
  font-size: 0.66rem; line-height: 17px; text-align: center; font-weight: 600;
}

/* ===== 區塊標題 ===== */
.section { margin-top: 30px; animation: fadeUp 0.7s var(--ease) both; }
.section:nth-of-type(2) { animation-delay: 0.1s; }
.section:nth-of-type(3) { animation-delay: 0.2s; }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.12rem; letter-spacing: 1px; margin-bottom: 14px;
}
.section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(var(--rose), var(--rose-deep));
}
.section-title em { font-style: normal; font-size: 0.72rem; color: var(--gold); letter-spacing: 2px; margin-top: 4px; }

/* ===== Banner ===== */
.banner {
  position: relative; overflow: hidden;
  height: 210px; margin-top: 18px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--ink);
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s var(--ease) both;
}
.banner::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 0, 0, 0.06), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(0, 0, 0, 0.05), transparent 45%),
    linear-gradient(140deg, #f3f3f3, #ffffff 58%, #efefef);
}
.banner-inner { position: relative; z-index: 1; padding: 20px; }
.banner-inner h1 { font-size: 2rem; letter-spacing: 3px; }
.banner-inner .sub { margin-top: 6px; font-size: 0.85rem; color: var(--ink-2); letter-spacing: 2px; }
.banner-inner .tag {
  display: inline-block; margin-top: 14px; padding: 5px 14px;
  border: 1px solid rgba(0, 0, 0, 0.4); border-radius: 20px;
  color: #555555; font-size: 0.72rem; letter-spacing: 2px;
}

/* ===== 公告 ===== */
.announce {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 8px; box-shadow: var(--shadow);
}
.announce ol { list-style: none; }
.announce li {
  display: flex; gap: 12px; padding: 11px 10px;
  border-bottom: 1px dashed var(--line);
}
.announce li:last-child { border-bottom: none; }
.announce .no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--rose-bg); color: var(--rose-deep);
  font-size: 0.78rem; font-weight: 700; text-align: center; line-height: 22px;
  margin-top: 2px;
}
.announce .txt { font-size: 0.88rem; color: var(--ink); }
.announce .txt b { color: var(--rose-deep); }

/* ===== 商品列表 ===== */
.count-line { font-size: 0.85rem; color: var(--ink-2); margin-bottom: 14px; letter-spacing: 0.5px; }
.count-line b { color: var(--ink); }

/* 分類 tab */
.cat-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; padding: 7px 15px; border: 1px solid var(--line); border-radius: 22px;
  background: #fff; color: var(--ink-2); font-size: 0.84rem; transition: all 0.2s var(--ease);
}
.cat-chip.active { background: #141414; border-color: #141414; color: #fff; }
.cat-chip:hover { border-color: var(--ink-2); }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-card .thumb { aspect-ratio: 1 / 1; width: 100%; background: linear-gradient(150deg, #f2f2f2, #fafafa); display: flex; align-items: center; justify-content: center; }
.product-card .thumb svg, .product-card .thumb img { width: 100%; height: 100%; }
.product-card .thumb img { object-fit: cover; }
.product-card .thumb svg { width: 82%; height: 82%; }
.product-card .meta { padding: 11px 13px 14px; }
.product-card .p-name { font-size: 0.92rem; line-height: 1.5; min-height: 2.7em; }
.product-card .p-cat { font-size: 0.7rem; color: var(--gold); letter-spacing: 1px; margin-top: 2px; }
.product-card .p-price { font-size: 0.95rem; color: var(--rose-deep); font-weight: 700; margin-top: 6px; }
.price-unit { font-size: 0.7rem; color: var(--ink-2); font-weight: 500; margin-right: 2px; }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 40px; font-size: 0.95rem; font-weight: 600;
  letter-spacing: 1px; transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #141414; color: #fff; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2); }
.btn-primary:hover { box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28); background: #000; }
.btn-ghost { background: var(--rose-bg); color: var(--ink); }
.btn-ghost:hover { background: #e9e9e9; }
.btn-gold { background: #3a3a3a; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.84rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 聯絡我們 ===== */
.contact { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.contact-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; font-size: 0.9rem; }
.contact-item .ic {
  flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--rose-bg);
  display: flex; align-items: center; justify-content: center; color: var(--rose-deep);
}
.contact-item .lbl { color: var(--ink-2); font-size: 0.75rem; letter-spacing: 1px; }
.contact-item .val { color: var(--ink); }
.contact-item .val a { color: var(--ink); border-bottom: 1px solid var(--ink-2); }

/* ===== 頁尾 ===== */
.footer { text-align: center; padding: 26px 18px 8px; color: var(--ink-2); font-size: 0.72rem; letter-spacing: 1px; }
.footer .gold { color: var(--gold); }

/* ===== 商品詳情 ===== */
.detail-thumb {
  margin: -18px -18px 0; aspect-ratio: 1/1; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #f2f2f2, #fafafa);
  display: flex; align-items: center; justify-content: center;
}
.detail-thumb svg { width: 72%; height: 72%; }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumbs { display: none; grid-auto-flow: column; gap: 8px; margin-top: 10px; overflow-x: auto; }
.detail-thumbs.show { display: grid; }
.d-thumb { width: 60px; height: 60px; padding: 0; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; flex: none; }
.d-thumb.active { border-color: var(--ink); }
.d-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-2); margin: 14px 0 10px; }

/* 確保返回連結不被黏性頂欄遮蔽 */
.page { position: relative; }
.page .back-link { position: relative; z-index: 2; }
.detail-name { font-size: 1.5rem; letter-spacing: 1px; margin-top: 14px; }
.detail-cat { color: var(--gold); font-size: 0.75rem; letter-spacing: 2px; margin-top: 4px; }
.detail-price { font-size: 1.5rem; color: var(--rose-deep); font-weight: 700; margin-top: 12px; }
.detail-desc { margin-top: 12px; color: var(--ink-2); font-size: 0.9rem; white-space: pre-line; }
.detail-stock { margin-top: 10px; font-size: 0.8rem; color: var(--ink-2); }
.detail-stock.ok { color: #3a3a3a; }

/* 規格 */
.field-label { display: block; font-size: 0.85rem; color: var(--ink-2); letter-spacing: 1px; margin: 18px 0 8px; }
.spec-group { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-chip {
  padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 22px;
  font-size: 0.85rem; color: var(--ink-2); background: #fff;
  transition: all 0.2s var(--ease);
}
.spec-chip.selected { border-color: var(--rose-deep); color: var(--rose-deep); background: var(--rose-bg); font-weight: 600; }

/* 數量 */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: #fff; }
.qty button { width: 40px; height: 40px; font-size: 1.2rem; color: var(--rose-deep); transition: background 0.2s; }
.qty button:hover { background: var(--rose-bg); }
.qty input { width: 44px; height: 40px; text-align: center; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* 詳情頁操作列 */
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

/* ===== 購物車 ===== */
.cart-item {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; margin-bottom: 12px; align-items: center;
  box-shadow: var(--shadow);
}
.cart-item .check { flex: none; }
.cart-check { width: 20px; height: 20px; accent-color: var(--rose-deep); }
.cart-item .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: linear-gradient(150deg, #f2f2f2, #fafafa); flex: none; }
.cart-item .thumb svg, .cart-item .thumb img { width: 100%; height: 100%; }
.cart-item .thumb img { object-fit: cover; }
.cart-item .thumb svg { width: 100%; height: 100%; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .i-name { font-size: 0.9rem; line-height: 1.4; }
.cart-item .i-spec { font-size: 0.74rem; color: var(--gold); margin-top: 2px; }
.cart-item .i-price { font-size: 0.9rem; color: var(--rose-deep); font-weight: 700; margin-top: 6px; }
.cart-item .del { color: var(--ink-2); font-size: 1.1rem; padding: 4px; line-height: 1; }

/* 結帳列 */
.checkout-bar {
  position: sticky; bottom: 0; margin-top: 12px; background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow);
}
.checkout-bar .sum { font-size: 1.05rem; color: var(--ink); display: flex; flex-direction: column; }
.checkout-bar .sum .amt { font-size: 1.35rem; color: var(--rose-deep); font-weight: 700; }
.checkout-bar .sum small { font-size: 0.72rem; color: var(--ink-2); }

/* ===== 表單（結帳） ===== */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.form-card h3 { font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-card h3::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: linear-gradient(var(--rose), var(--rose-deep)); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0.5px; }
.field label b { color: var(--rose-deep); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--rose-deep); }
.field textarea { resize: vertical; min-height: 62px; }

/* 選項卡（取貨/付款） */
.option-group { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.option:hover { border-color: var(--rose); }
.option.selected { border-color: var(--rose-deep); background: var(--rose-bg); }
.option input { accent-color: var(--rose-deep); width: 17px; height: 17px; flex: none; }
.option .o-body { flex: 1; }
.option .o-title { font-weight: 600; font-size: 0.92rem; }
.option .o-sub { font-size: 0.75rem; color: var(--ink-2); }
.option .o-fee { font-size: 0.85rem; color: var(--rose-deep); font-weight: 700; flex: none; }

.hint { background: var(--rose-bg); color: var(--rose-deep); border-radius: 12px; padding: 10px 13px; font-size: 0.8rem; margin-top: 12px; }
.hint b { color: var(--rose-deep); }

/* 金額匯總 */
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 7px 0; color: var(--ink-2); }
.summary-row .val { color: var(--ink); }
.summary-row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.05rem; color: var(--ink); font-weight: 700; }
.summary-row.total .val { color: var(--rose-deep); font-size: 1.3rem; }

/* ===== 結果頁 ===== */
.result-card { text-align: center; padding: 34px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); animation: fadeUp 0.7s var(--ease) both; }
.result-icon { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.result-icon.ok { background: var(--rose-bg); color: var(--rose-deep); }
.result-card h2 { font-size: 1.4rem; letter-spacing: 1px; }
.result-card .no { margin-top: 10px; font-size: 0.95rem; color: var(--ink-2); }
.result-card .no b { color: var(--ink); letter-spacing: 0.5px; }
.result-card .demo-note {
  margin-top: 14px; display: inline-block; padding: 6px 14px; border-radius: 20px;
  background: var(--rose-bg); color: var(--rose-deep); font-size: 0.78rem; letter-spacing: 1px;
}
.result-block { text-align: left; margin-top: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.result-block .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.86rem; color: var(--ink-2); }
.result-block .row b { color: var(--ink); font-weight: 600; }
.result-actions { margin-top: 20px; display: grid; gap: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 30px;
  font-size: 0.85rem; opacity: 0; pointer-events: none; transition: all 0.35s var(--ease); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 空狀態 */
.empty { text-align: center; color: var(--ink-2); padding: 48px 20px; }
.empty .e-ic { font-size: 2.4rem; margin-bottom: 10px; }
.empty p { font-size: 0.95rem; }
.empty .btn { margin-top: 18px; }

/* 工具 */
.text-center { text-align: center; }
.mt12 { margin-top: 12px; }
.mt20 { margin-top: 20px; }

/* ===== 查詢訂單頁 ===== */
.page-sub { font-size: 0.9rem; color: var(--ink-2); line-height: 1.7; margin-bottom: 18px; }
.page-sub strong { color: var(--ink); font-weight: 600; }
.query-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.q-result { margin-top: 24px; }
.q-result-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.q-order-list { display: flex; flex-direction: column; gap: 12px; }
.q-empty { font-size: 0.9rem; color: var(--ink-2); text-align: center; padding: 28px 12px; background: var(--bg-2); border-radius: 10px; }
.q-order { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--card); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.q-order:active { transform: scale(.99); }
.q-order-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.q-no { font-size: 0.82rem; color: var(--ink); font-weight: 600; letter-spacing: .2px; }
.q-items { list-style: none; padding: 0 0 10px; margin: 0 0 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.q-items li { font-size: 0.85rem; color: var(--ink); line-height: 1.5; }
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--ink-2); }
.q-amount { font-size: 1rem; font-weight: 700; color: var(--ink); }
.q-date { margin-top: 8px; font-size: 0.75rem; color: var(--ink-3); }

/* 狀態徽章（查詢頁 / 後台共用） */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge-paid { background: var(--bg-2); color: var(--ink); }
.badge-pending { background: var(--bg-2); color: var(--ink-2); }
.badge-fail { background: #141414; color: #fff; }

.hidden { display: none !important; }