:root {
  --ink: #221e1a;
  --paper: #f3efe6;
  --card: #fffcf8;
  --line: #e5dcd0;
  --muted: #746b62;
  --seal: #8c2f2f;
  --safe-b: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #e7e1d6;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; color: inherit; }

button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

#app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  padding: 20px 16px calc(28px + var(--safe-b));
}

.hero, .row, .photo, .spec, .actions, .links {
  display: flex;
  align-items: center;
}

.hero { gap: 12px; margin-bottom: 16px; }
.hero-copy { flex: 1; min-width: 0; }

.seal {
  width: 44px;
  height: 44px;
  border: 2px solid var(--seal);
  color: var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.brand { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.sub, .muted, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.6; }
.kicker { color: var(--seal); font-size: 12px; letter-spacing: 1px; }

.card, .field, .ticket, .product, .banner, .error {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card, .ticket, .product, .banner, .error { padding: 14px; }
.field { padding: 10px 12px; margin-bottom: 10px; }
.field label, .section {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.section { margin: 18px 0 8px; letter-spacing: 1px; }

input, select, textarea {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  line-height: 1.4;
  padding: 8px 0;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.adder-block { margin: 0 0 14px; }
.adder-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.adder { display: flex; gap: 8px; align-items: stretch; }
.adder input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}
.adder .btn {
  width: auto;
  min-width: 96px;
  margin: 0;
  flex: 0 0 auto;
}
.build {
  margin: 28px 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.ticket { display: flex; padding: 0; overflow: hidden; margin-bottom: 14px; }
.bar { width: 6px; background: var(--seal); flex-shrink: 0; }
.ticket-body { padding: 12px 14px; }
.rate-line { font-size: 18px; font-weight: 700; margin-top: 4px; }

.btn {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: 999px;
  min-height: 48px;
  line-height: 48px;
  font-weight: 700;
  margin-top: 10px;
}
.primary { background: var(--seal); color: #fffcf8; }
.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.line { background: var(--card); border: 1.5px solid var(--line); }
.btn[disabled] { opacity: 0.55; }

.who { color: var(--seal); font-size: 13px; }

.search, .chips { margin-top: 12px; }
.search input {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
}
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }

.product { gap: 12px; margin-top: 12px; text-align: left; width: 100%; }
.thumb {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  background: #ebe4d8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 4px;
}
.product-name { font-weight: 700; }
.twd { color: var(--seal); font-size: 18px; font-weight: 700; margin-top: 4px; }

.photo { gap: 10px; margin-bottom: 10px; }
.photo .thumb { width: 72px; height: 72px; }
.photo-main { flex: 1; min-width: 0; }
.links { gap: 14px; }
.link { color: var(--seal); font-size: 14px; background: none; border: 0; min-height: 32px; }

.dims { display: flex; gap: 8px; }
.dims .field { flex: 1; }
.unit { color: var(--muted); font-size: 13px; }

.preview { background: #fff8f4; }
.big { font-size: 28px; font-weight: 700; color: var(--seal); }
.board { background: var(--ink); color: #fffcf8; }
.board .kicker, .board .muted { color: #e7c7c0; }
.board .big { color: #fffcf8; font-size: 40px; }

.spec { justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.spec span:first-child { color: var(--muted); flex-shrink: 0; }
.spec span:last-child { text-align: right; }

.gallery {
  background: #ebe4d8;
  border-radius: 14px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery img { width: 100%; max-height: 360px; object-fit: contain; }
.actions { gap: 8px; margin-top: 16px; }
.actions .btn { flex: 1; margin-top: 0; }

.error { color: var(--seal); margin: 8px 0; }
.banner { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.hidden { display: none; }
