:root {
  --ink: #111210;
  --paper: #f3f1eb;
  --white: #fffefa;
  --line: #d8d5cc;
  --muted: #72736b;
  --lime: #b8ee30;
  --red: #ef533f;
  --blue: #318eb9;
  --font: "Noto Sans TC", sans-serif;
  --display: "Barlow Condensed", "Noto Sans TC", sans-serif;
  --shell: min(1240px, calc(100% - 48px));
}

* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
svg { display: block; width: 18px; height: 18px; stroke-width: 1.8; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.shell { width: var(--shell); margin: 0 auto; }

.sub-header { position: sticky; z-index: 30; top: 0; background: rgba(255, 254, 250, .97); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.sub-header-inner { display: grid; grid-template-columns: 220px 1fr auto; align-items: center; min-height: 68px; gap: 24px; }
.sub-brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; font-family: var(--display); font-size: 21px; font-weight: 800; line-height: .8; }
.sub-brand > span { display: grid; width: 37px; height: 37px; place-items: center; background: var(--lime); border: 2px solid var(--ink); transform: rotate(-3deg); }
.sub-brand b > span { color: var(--red); }
.sub-brand small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.sub-nav { display: flex; align-items: center; justify-content: center; gap: 24px; }
.sub-nav a { position: relative; min-height: 68px; display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; white-space: nowrap; }
.sub-nav a:hover, .sub-nav a.active { color: #a53425; }
.sub-nav a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--red); content: ""; }
.header-tools { display: flex; align-items: center; gap: 7px; }
.header-icon { position: relative; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.header-icon:hover { background: #eceae4; }
.header-icon b { position: absolute; top: -5px; right: -5px; display: grid; min-width: 18px; height: 18px; place-items: center; padding: 0 4px; color: white; background: var(--red); border: 2px solid white; border-radius: 10px; font-family: var(--display); font-size: 8px; }
.mobile-nav-button { display: none; }

.page-hero { position: relative; overflow: hidden; color: white; background: var(--ink); border-bottom: 4px solid var(--lime); }
.page-hero::before { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 42px 42px; content: ""; }
.page-hero-inner { position: relative; display: flex; min-height: 215px; align-items: flex-end; justify-content: space-between; gap: 35px; padding-top: 45px; padding-bottom: 38px; }
.page-kicker { margin: 0 0 8px; color: var(--lime); font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.page-hero h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; }
.page-hero-copy { max-width: 560px; margin: 12px 0 0; color: #a9aaa2; font-size: 11px; line-height: 1.75; }
.hero-stat { flex: 0 0 auto; padding: 15px 18px; color: var(--ink); background: var(--lime); border: 2px solid var(--ink); transform: rotate(-2deg); }
.hero-stat span { display: block; font-size: 8px; font-weight: 700; }
.hero-stat strong { display: block; margin-top: 2px; font-family: var(--display); font-size: 28px; }

.page-main { min-height: 55vh; padding: 34px 0 70px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 19px; padding: 11px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.toolbar-group { display: flex; align-items: center; gap: 7px; }
.toolbar-search { position: relative; display: flex; align-items: center; }
.toolbar-search svg { position: absolute; left: 11px; color: #777870; pointer-events: none; }
.toolbar input, .toolbar select, .form-field input, .form-field select, .form-field textarea { min-height: 39px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 4px; outline: 0; font-size: 9px; }
.toolbar input:focus, .toolbar select:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #76776f; }
.toolbar-search input { width: min(300px, 35vw); padding-left: 36px; }
.result-count { color: var(--muted); font-size: 9px; white-space: nowrap; }

.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.listing-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 6px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.listing-card:hover { border-color: #96978f; box-shadow: 0 12px 26px rgba(22,23,20,.08); transform: translateY(-2px); }
.listing-image { position: relative; display: grid; aspect-ratio: 1.28 / 1; place-items: center; overflow: hidden; background: #ebe9e2; }
.listing-image.portrait { aspect-ratio: 3 / 4; }
.listing-image img { width: 100%; height: 100%; object-fit: contain; background: white; transition: transform .25s ease; }
.listing-card:hover .listing-image img { transform: scale(1.025); }
.listing-image span { position: absolute; top: 9px; left: 9px; padding: 4px 7px; color: white; background: var(--ink); border-radius: 3px; font-size: 7px; font-weight: 800; }
.listing-image span.preorder { color: var(--ink); background: var(--lime); }
.listing-info { display: flex; flex: 1; flex-direction: column; padding: 13px; }
.listing-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-family: var(--display); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.listing-info h2 { min-height: 43px; margin: 8px 0 4px; font-size: 12px; line-height: 1.5; }
.listing-info p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.listing-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 15px; }
.listing-price { font-family: var(--display); font-size: 22px; font-weight: 800; }
.listing-add, .primary-button, .secondary-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border-radius: 4px; font-size: 9px; font-weight: 800; }
.listing-add { width: 37px; padding: 0; color: white; background: var(--ink); border: 1px solid var(--ink); }
.listing-add:hover { color: var(--ink); background: var(--lime); }
.listing-add:disabled { color: #92938b; background: #d8d6cf; border-color: #c4c2ba; cursor: not-allowed; }
.primary-button { color: white; background: var(--ink); border: 1px solid var(--ink); }
.primary-button:hover { color: var(--ink); background: var(--lime); }
.secondary-button { background: white; border: 1px solid var(--ink); }
.secondary-button:hover { background: #eceae4; }
.empty-state { grid-column: 1 / -1; padding: 60px 20px; text-align: center; background: white; border: 1px dashed #aaa89f; }
.empty-state svg { width: 36px; height: 36px; margin: 0 auto 10px; color: #8c8d85; }
.empty-state h2 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 9px; }

.product-layout { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(360px, 1.05fr); overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 6px; }
.product-detail-image { display: grid; min-height: 520px; place-items: center; padding: 35px; background: #ebe9e2; border-right: 1px solid var(--line); }
.product-detail-image img { max-width: 100%; max-height: 500px; object-fit: contain; filter: drop-shadow(0 20px 20px rgba(0,0,0,.14)); }
.product-detail-info { display: flex; flex-direction: column; justify-content: center; padding: 45px; }
.product-detail-info .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 7px; background: #eceae4; border-radius: 3px; font-family: var(--display); font-size: 8px; font-weight: 700; }
.product-detail-info h1 { margin: 16px 0 8px; font-size: clamp(25px, 3vw, 38px); line-height: 1.25; }
.product-detail-info > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.detail-price { margin: 27px 0 17px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-price span { display: block; color: var(--muted); font-size: 8px; }
.detail-price strong { display: block; margin-top: 4px; font-family: var(--display); font-size: 35px; }
.detail-actions { display: flex; gap: 8px; }
.detail-actions .primary-button { flex: 1; min-height: 44px; }
.detail-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.detail-notes div { padding: 10px; background: #f2f0e9; border-radius: 4px; }
.detail-notes b { display: block; font-size: 8px; }
.detail-notes small { display: block; margin-top: 3px; color: var(--muted); font-size: 7px; line-height: 1.5; }

.auction-list { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 6px; }
.auction-item { display: grid; grid-template-columns: 105px minmax(220px, 1.5fr) repeat(3, minmax(85px, .55fr)) auto; align-items: center; gap: 15px; min-height: 130px; padding: 14px; border-bottom: 1px solid #e7e5de; }
.auction-item:last-child { border-bottom: 0; }
.auction-thumb { display: grid; width: 90px; height: 100px; place-items: center; overflow: hidden; background: #eceae4; border-radius: 4px; }
.auction-thumb img { width: 100%; height: 100%; object-fit: contain; }
.auction-title span { color: var(--red); font-family: var(--display); font-size: 9px; font-weight: 700; }
.auction-title h2 { margin: 5px 0; font-size: 12px; }
.auction-title small, .auction-data span { color: var(--muted); font-size: 8px; }
.auction-data strong { display: block; margin-top: 4px; font-family: var(--display); font-size: 17px; }

.report-tabs { display: flex; gap: 6px; margin-bottom: 17px; overflow-x: auto; }
.report-tabs button { min-width: max-content; min-height: 34px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 4px; font-family: var(--display); font-size: 9px; font-weight: 700; }
.report-tabs button.active { color: white; background: var(--ink); border-color: var(--ink); box-shadow: inset 0 -3px var(--lime); }
.deck-table { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 6px; }
.deck-row { display: grid; grid-template-columns: 55px minmax(220px, 1.3fr) repeat(3, minmax(90px, .45fr)) auto; align-items: center; gap: 14px; min-height: 88px; padding: 13px 16px; border-bottom: 1px solid #e7e5de; }
.deck-row:last-child { border-bottom: 0; }
.deck-rank { font-family: var(--display); font-size: 25px; font-weight: 800; }
.deck-name h2 { margin: 0 0 4px; font-size: 12px; }
.deck-name span, .deck-data span { color: var(--muted); font-size: 8px; }
.deck-data strong { display: block; margin-top: 3px; font-family: var(--display); font-size: 16px; }

.service-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(380px, 1.3fr); gap: 16px; }
.service-menu, .form-panel, .faq-panel, .lookup-panel, .result-panel { background: white; border: 1px solid var(--line); border-radius: 6px; }
.service-menu { align-self: start; padding: 18px; }
.service-menu h2, .form-panel h2, .faq-panel h2, .lookup-panel h2, .result-panel h2 { margin: 0; font-size: 17px; }
.service-menu > p, .form-panel > p, .lookup-panel > p, .result-panel > p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.service-options { margin-top: 18px; border-top: 1px solid var(--line); }
.service-options a { display: flex; align-items: center; justify-content: space-between; min-height: 51px; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; }
.service-options a:hover { color: #a53425; }
.store-block { margin-top: 22px; padding: 14px; color: #ddd; background: var(--ink); border-radius: 4px; }
.store-block b { display: block; color: white; font-size: 10px; }
.store-block p { margin: 7px 0 0; color: #9b9c94; font-size: 8px; line-height: 1.7; }
.form-panel, .lookup-panel, .result-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .form-field > span { font-size: 8px; font-weight: 700; }
.form-field textarea { min-height: 130px; padding-top: 10px; resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-actions small { color: var(--muted); font-size: 7px; }
.form-message { margin-top: 15px; padding: 12px; background: #edf6d8; border-left: 4px solid var(--lime); font-size: 9px; line-height: 1.6; }
.form-message.error { color: #a53425; background: #fae7e2; border-color: var(--red); }
.honeypot { position: absolute !important; left: -10000px !important; }
.faq-panel { grid-column: 1 / -1; padding: 24px; }
.faq-list { margin-top: 17px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 15px 0; font-size: 9px; font-weight: 700; cursor: pointer; }
.faq-list details p { margin: -3px 0 15px; color: var(--muted); font-size: 8px; line-height: 1.75; }

.account-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(360px, 1.2fr); gap: 16px; }
.order-summary { margin-top: 18px; border-top: 1px solid var(--line); }
.order-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e7e5de; font-size: 8px; }
.order-summary-row strong { font-family: var(--display); font-size: 13px; }
.order-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e7e5de; }
.order-item span { display: flex; flex-direction: column; }
.order-item b { font-size: 9px; }
.order-item small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.order-item strong { font-family: var(--display); font-size: 12px; }
.status-pill { display: inline-flex; width: max-content; padding: 4px 7px; color: #36713b; background: #e5f2e4; border-radius: 10px; font-size: 7px; font-weight: 700; }

.sub-footer { color: #cfcfc7; background: var(--ink); }
.sub-footer-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; min-height: 88px; }
.sub-footer p { margin: 6px 0 0; color: #7e7f77; font-size: 8px; }
.sub-footer nav { display: flex; gap: 18px; color: #9b9c94; font-size: 8px; }
.sub-footer nav a:hover { color: var(--lime); }
.toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 36px); padding: 12px 14px; color: white; background: var(--ink); border: 1px solid #3e3f3a; border-radius: 4px; font-size: 9px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .18s ease; }
.toast.show { opacity: 1; transform: none; }
.toast svg { color: var(--lime); }

@media (max-width: 980px) {
  :root { --shell: min(100% - 32px, 900px); }
  .sub-header-inner { grid-template-columns: 1fr auto; }
  .sub-nav { position: fixed; z-index: 40; top: 68px; right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 18px; background: white; border-bottom: 1px solid var(--line); box-shadow: 0 15px 25px rgba(0,0,0,.12); }
  .sub-nav.open { display: flex; }
  .sub-nav a { min-height: 45px; border-bottom: 1px solid var(--line); }
  .sub-nav a.active::after { display: none; }
  .mobile-nav-button { display: grid; }
  .listing-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .product-layout { grid-template-columns: 1fr; }
  .product-detail-image { min-height: 400px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auction-item, .deck-row { min-width: 850px; }
  .auction-list, .deck-table { overflow-x: auto; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100% - 28px); }
  .sub-brand { font-size: 18px; }
  .sub-brand > span { width: 33px; height: 33px; }
  .header-tools .account-tool { display: none; }
  .page-hero-inner { min-height: 190px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .hero-stat { display: none; }
  .page-main { padding-top: 22px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-search { grid-column: 1 / -1; }
  .toolbar-search input { width: 100%; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .listing-info { padding: 10px; }
  .listing-info h2 { min-height: 53px; font-size: 10px; }
  .listing-meta { font-size: 7px; }
  .listing-price { font-size: 18px; }
  .product-detail-image { min-height: 315px; padding: 20px; }
  .product-detail-info { padding: 23px; }
  .detail-notes { grid-template-columns: 1fr; }
  .service-grid, .account-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full, .form-actions { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary-button { width: 100%; }
  .sub-footer-inner { grid-template-columns: 1fr; padding: 22px 0; }
  .sub-footer nav { flex-wrap: wrap; gap: 9px 15px; }
}