/* STR Network 辦公室物品出清 — 沿用官網（strnetwork-about）的深色編輯風格：
   標題用 Oswald 大寫、內文 Noto Sans TC、細分隔線、黃色只用在重點。 */
:root {
  --bg: #151514;
  --surface: #1d1d1b;
  --surface-2: #252523;
  --fg: #f4f2ec;
  --soft: rgba(244, 242, 236, 0.74);
  --muted: rgba(244, 242, 236, 0.5);
  --rule: rgba(244, 242, 236, 0.14);
  --rule-strong: rgba(244, 242, 236, 0.34);
  --yellow: #ffdb1e;
  --ink: #151514;
  --display: 'Oswald', 'Noto Sans TC', sans-serif;
  --gutter: clamp(16px, 4.2vw, 60px);
  --max: 1440px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  line-break: strict;
}
::selection { background: var(--yellow); color: var(--ink); }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.offscreen { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }

/* Header */
.hdr { border-bottom: 1px solid var(--rule); }
.hdr-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo img { width: 150px; height: auto; }
.hdr-link { font-size: 14px; color: var(--soft); text-decoration: none; letter-spacing: .06em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px; }
.hdr-link:hover { color: var(--fg); border-color: var(--fg); }

/* Hero */
.hero { padding: 40px 0 32px; }
.eyebrow { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--rule-strong); font-family: var(--display); font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.display { margin: 16px 0 0; font-family: var(--display); font-weight: 500; font-size: clamp(64px, 15vw, 200px); line-height: .9; letter-spacing: -.01em; color: var(--fg); }
.hero h1 { margin: 16px 0 0; font-size: clamp(24px, 4vw, 36px); line-height: 1.3; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.h1-sub { font-size: .7em; font-weight: 500; color: var(--soft); }
.star { color: var(--yellow); margin-right: 8px; font-size: .8em; }
.lead { margin: 12px 0 28px; color: var(--soft); max-width: 40em; }
.facts { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0; }
.facts div { border-top: 1px solid var(--rule-strong); padding: 14px 0 18px; }
.facts dt { font-size: 14px; color: var(--soft); display: flex; gap: 10px; align-items: baseline; }
.facts .en { font-family: var(--display); font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 16px; font-weight: 500; }
.notice { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.notice summary { cursor: pointer; padding: 14px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.notice summary::-webkit-details-marker { display: none; }
.notice summary::after { content: "+"; font-family: var(--display); font-size: 22px; color: var(--muted); }
.notice[open] summary::after { content: "−"; }
.notice-body { display: grid; gap: 8px 40px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); padding-bottom: 18px; }
.notice h3 { font-size: 14px; margin: 0 0 6px; color: var(--yellow); font-weight: 500; }
.notice ul { margin: 0; padding-left: 1.2em; color: var(--soft); font-size: 15px; }

/* Toolbar */
.toolbar { position: sticky; top: 0; z-index: 20; background: rgba(21, 21, 20, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--rule); padding-top: 12px; }
.search-row { display: flex; gap: 12px; align-items: stretch; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--rule-strong); min-width: 0; }
.search:focus-within { border-color: var(--fg); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.tabs { display: flex; gap: 24px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; padding: 4px 0; font-size: 15px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--fg); }
.tab small { font-family: var(--display); font-size: 12px; letter-spacing: .06em; }
.tab[aria-pressed="true"] { color: var(--fg); }
.tab[aria-pressed="true"]::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }

/* Buttons */
.btn-primary, .btn-line { padding: 10px 20px; font-weight: 500; white-space: nowrap; letter-spacing: .04em; border-radius: 0; }
.btn-primary { background: var(--yellow); color: var(--ink); border: 1px solid var(--yellow); }
.btn-primary:hover { background: #fff07a; }
.btn-line { background: transparent; border: 1px solid var(--rule-strong); }
.btn-line:hover, .btn-line[aria-expanded="true"] { border-color: var(--fg); }
.badge { display: inline-block; margin-left: 8px; background: var(--yellow); color: var(--ink); border-radius: 999px; font-family: var(--display); font-size: 12px; padding: 0 7px; line-height: 20px; }
.link { background: none; border: 0; padding: 0 0 2px; color: var(--soft); border-bottom: 1px solid var(--rule-strong); font-size: 14px; }
.link:hover { color: var(--fg); border-color: var(--fg); }
.icon-btn { background: none; border: 0; font-size: 28px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.icon-btn:hover { color: var(--fg); }

/* Filters */
.filters { border-bottom: 1px solid var(--rule); padding: 20px 0 16px; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.filters legend { font-family: var(--display); font-size: 12px; letter-spacing: .18em; color: var(--muted); margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--rule-strong); background: transparent; padding: 4px 12px; font-size: 14px; color: var(--soft); }
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 500; }
.size-group { margin-bottom: 10px; }
.size-group p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--yellow); }
.select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); }
.select select { border: 1px solid var(--rule-strong); border-radius: 0; padding: 6px 8px; background: var(--bg); color: var(--fg); }

.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 16px; flex-wrap: wrap; }
.result-bar p { margin: 0; color: var(--muted); font-size: 14px; }
.result-tools { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.mini-pager { display: inline-flex; align-items: center; gap: 2px; }
.mini-pager button { width: 34px; height: 34px; border: 1px solid var(--rule-strong); background: transparent; font-size: 18px; line-height: 1; }
.mini-pager button:hover:not(:disabled) { border-color: var(--fg); }
.mini-pager button:disabled { opacity: .3; cursor: default; }
.mini-pos { font-family: var(--display); font-size: 15px; letter-spacing: .06em; min-width: 64px; text-align: center; }

/* Grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; height: 100%; }
.card.sold { opacity: .5; }
.card-open { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; }
.card-open:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.thumb { aspect-ratio: 1 / 1; background: var(--surface); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.card-open:hover .thumb img { transform: scale(1.05); }
.thumb .no-photo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.tag { position: absolute; top: 0; left: 0; background: rgba(21, 21, 20, .82); color: var(--fg); font-size: 12px; padding: 2px 8px; }
.tag.sold-tag { background: var(--yellow); color: var(--ink); font-family: var(--display); letter-spacing: .12em; }
/* 每張卡片的文字區塊固定行數，價格與按鈕才會在同一水平線 */
.card-body { padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.card-code { font-family: var(--display); font-size: 12px; letter-spacing: .12em; color: var(--muted); line-height: 1.4; }
.card-name { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.45; min-height: calc(1.45em * 2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-spec { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.price { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .02em; line-height: 1.2; }
.stock { font-size: 12px; color: var(--muted); white-space: nowrap; }
.add-btn { width: 100%; border: 1px solid var(--rule-strong); background: transparent; padding: 8px 12px; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
.add-btn:hover:not(:disabled) { border-color: var(--fg); }
.add-btn.in-cart { border-color: var(--yellow); color: var(--yellow); }
.add-btn:disabled { color: var(--muted); cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 48px 0; }
.pager button { min-width: 40px; height: 40px; border: 0; background: none; font-family: var(--display); font-size: 16px; color: var(--muted); border-bottom: 2px solid transparent; }
.pager button:hover:not(:disabled) { color: var(--fg); }
.pager button[aria-current="page"] { color: var(--fg); border-color: var(--yellow); }
.pager button:disabled { opacity: .3; cursor: default; }
.pager .gap { align-self: center; color: var(--muted); padding: 0 4px; }

/* Footer */
.ftr { border-top: 1px solid var(--rule); margin-top: 24px; padding: 28px 0 120px; }
.ftr-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ftr img { width: 120px; height: auto; opacity: .7; }
.ftr p { margin: 0; color: var(--muted); font-size: 13px; }

/* Floating cart */
.cart-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--ink); border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.cart-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.fab-count { background: var(--ink); color: var(--yellow); border-radius: 999px; min-width: 24px; text-align: center; padding: 0 6px; font-family: var(--display); font-size: 14px; }
.cart-fab.bump { animation: bump .3s; }
@keyframes bump { 50% { transform: scale(1.08); } }

/* Dialogs */
.sheet { border: 1px solid var(--rule); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.sheet::backdrop { background: rgba(0, 0, 0, .7); }
@media (max-width: 639px) {
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; border-width: 1px 0 0; }
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.sheet-body { padding: 20px; overflow-y: auto; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px 16px; padding: 0 20px; }
.gallery img { flex: none; width: 100%; max-height: 60vh; object-fit: contain; background: var(--bg); scroll-snap-align: center; }
.gallery.multi img { width: 88%; }
.detail-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: 15px; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; }
.qty-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); }
.stepper button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 18px; }
.stepper button:disabled { color: var(--rule-strong); cursor: default; }
.stepper input { width: 44px; text-align: center; border: 0; border-left: 1px solid var(--rule-strong); border-right: 1px solid var(--rule-strong); height: 36px; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.callout { border-left: 2px solid var(--yellow); color: var(--soft); padding: 4px 0 4px 12px; margin: 0 0 16px; font-size: 14px; }
.warn { border-left: 2px solid var(--rule-strong); background: var(--surface-2); color: var(--soft); padding: 8px 12px; margin: 0 0 16px; font-size: 14px; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.cart-line img, .cart-line .ph { width: 56px; height: 56px; object-fit: cover; background: var(--bg); }
.cart-line .name { font-size: 15px; font-weight: 700; line-height: 1.4; }
.cart-line .sub { font-size: 13px; color: var(--muted); }
.cart-line .right { display: flex; flex-direction: column; align-items: end; gap: 6px; }
.cart-empty { color: var(--muted); text-align: center; padding: 16px 0; }
.cart-total { font-family: var(--display); font-size: 20px; font-weight: 500; text-align: right; margin: 16px 0; letter-spacing: .02em; }
#buyer-form h3 { margin: 20px 0 12px; font-family: var(--display); font-size: 12px; letter-spacing: .18em; color: var(--muted); font-weight: 400; border-top: 1px solid var(--rule-strong); padding-top: 14px; }
#buyer-form label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
#buyer-form input, #buyer-form select, #buyer-form textarea, .manual-copy textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--rule-strong); border-radius: 0; padding: 10px 12px; font-size: 16px; font-weight: 400; background: var(--bg); color: var(--fg); }
#buyer-form input:focus, #buyer-form select:focus, #buyer-form textarea:focus { border-color: var(--fg); outline: none; }
#buyer-form [aria-invalid="true"] { border-color: var(--yellow); }
.req { color: var(--yellow); font-weight: 400; font-size: 12px; margin-left: 4px; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.err { display: block; color: var(--yellow); font-weight: 400; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { flex: 1; min-width: 140px; }
.manual-copy { margin-top: 16px; border-left: 2px solid var(--yellow); padding-left: 12px; }
.manual-copy p { margin: 0 0 4px; font-size: 14px; color: var(--soft); }
.hint { color: var(--soft); font-size: 14px; margin: 12px 0 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:not(:empty) { margin: 4px 0 14px; }
.fallback { margin-top: 16px; border-left: 2px solid var(--yellow); padding-left: 12px; }
.fallback p { margin: 0 0 8px; font-size: 14px; color: var(--soft); }
.fallback .btn-line { display: inline-block; text-decoration: none; }
.done { border-left: 2px solid var(--yellow); padding: 4px 0 4px 14px; margin: 8px 0 16px; }
.done-title { font-family: var(--display); font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.done p { color: var(--soft); margin: 0; }
.btn-primary:disabled { opacity: .5; cursor: progress; }
.hint a { color: var(--soft); }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; background: var(--fg); color: var(--ink); padding: 10px 16px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }

@media (prefers-reduced-motion: reduce) {
  .thumb img, .cart-fab.bump { transition: none; animation: none; }
}

/* 下拉選單：自畫箭頭，與右邊框保持距離 */
#buyer-form select, .select select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23f4f2ec' stroke-opacity='.74' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 40px;
}
.select select { background-position: right 10px center; padding-right: 32px; }
