:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #2b2723;
  --muted: #6b635b;
  --line: #e6dfd5;
  --accent: #b4532a;
  --accent-dark: #933f1d;
  --ok: #2f6b3a;
  --bad: #a3261f;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #e0a37f;
  outline-offset: 2px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.site-header nav a { margin-left: 18px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.site-header nav a:hover { color: var(--accent); }

main { max-width: 960px; margin: 0 auto; padding: 32px 20px 64px; }

.test-banner {
  background: #fff4d6;
  border-bottom: 1px solid #f0dca0;
  text-align: center;
  font-size: 14px;
  padding: 6px 12px;
}

.product { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 760px) { .product { grid-template-columns: 1fr 1fr; align-items: start; } }
.product img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.product h1 { margin: 0 0 4px; font-size: 28px; line-height: 1.3; }
.tagline { color: var(--muted); margin: 0 0 16px; }
.price { font-size: 26px; font-weight: 700; margin: 8px 0 20px; }
.product ul { padding-left: 20px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.narrow { max-width: 560px; margin: 0 auto; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 28px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 14px; color: var(--bad); min-height: 0; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }

.summary { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; margin: 8px 0 20px; font-size: 18px; }
.summary strong { font-size: 22px; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alert.error { background: #fbeceb; color: var(--bad); }
.alert.ok { background: #e9f3ea; color: var(--ok); }

.result { text-align: center; }
.result .icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.result h1 { margin: 0 0 12px; }
.order-no { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: #f3eee6; padding: 4px 10px; border-radius: 8px; }
.actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

dl.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 16px 0 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
.status-paid { color: var(--ok); font-weight: 700; }
.status-pending { color: #8a6a00; font-weight: 700; }
.status-failed { color: var(--bad); font-weight: 700; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lookup-link { text-align: left; background: #f8f4ee; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 16px; font-size: 14px; }
.lookup-link p { margin: 0 0 8px; }
.lookup-link p:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.lookup-link input { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lookup-link .btn { padding: 8px 16px; font-size: 14px; }

/* 預購與插畫說明 */
.notice { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 15px; }
.notice.preorder { background: #fff4d6; border: 1px solid #f0dca0; }
.notice.art { background: #eef1f8; border: 1px solid #d3daea; }

/* 尺寸 */
fieldset.sizes { border: 0; padding: 0; margin: 8px 0 4px; }
fieldset.sizes legend { font-weight: 600; margin-bottom: 8px; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-option { position: relative; }
.size-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size-option { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.size-option:has(input:checked) { border-color: var(--accent); background: #fbeee8; color: var(--accent-dark); }
.size-option:has(input:focus-visible) { outline: 3px solid #e0a37f; outline-offset: 2px; }
#size-error { min-height: 1.4em; }
.size-chart { border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; }
.size-chart caption { text-align: left; font-weight: 600; margin-bottom: 4px; }
.size-chart th, .size-chart td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }

/* 商品卡片（一次買一樣） */
.page-title { margin: 0 0 16px; }
.products { display: grid; grid-template-columns: 1fr; gap: 24px; margin: 16px 0; }
@media (min-width: 760px) { .products { grid-template-columns: 1fr 1fr; } }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.product-card img { width: 100%; height: auto; border-radius: 10px; background: #f3ece2; }
.product-card h2 { margin: 12px 0 4px; font-size: 22px; line-height: 1.3; }
.product-card .price { margin: 4px 0 8px; font-size: 22px; }
.product-card ul { padding-left: 20px; color: var(--muted); margin: 8px 0; }
.product-card .error { min-height: 1.4em; color: var(--bad); font-size: 14px; }

.notice.test { background: #fdecea; border: 1px solid #f3b8b1; color: var(--bad); font-weight: 600; }
