:root {
  color-scheme: light;
  --ink: #20231f;
  --muted: #686b63;
  --paper: #f7f4ed;
  --card: #fffdf8;
  --line: #ded9cd;
  --green: #1f6a4c;
  --green-dark: #164b38;
  --green-soft: #e4f1e9;
  --orange: #ef6b3b;
  --shadow: 0 10px 30px rgba(52, 45, 32, 0.09);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% -5%, rgba(239, 107, 59, .12), transparent 28rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-size: 18px;
  line-height: 1.5;
  padding-bottom: 128px;
}

button, input, textarea { font: inherit; }
button { touch-action: manipulation; }

.page-header,
main {
  width: min(760px, calc(100% - 32px));
  margin-inline: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .12em;
}

h1, h2 { line-height: 1.2; }
h1 { margin: 0; font-size: clamp(34px, 8vw, 52px); letter-spacing: -.04em; }
.intro { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 20px; }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff4d9;
  border: 1px solid #ead7a7;
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 18px;
  color: #6b5520;
}
.notice p { margin: 0; font-size: 15px; }

.product-list { display: grid; gap: 14px; }

.product-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 205px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.product-image-link { display: block; min-height: 100%; background: #ece8dd; }
.product-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info { display: flex; flex-direction: column; padding: 20px; }
.product-heading { display: flex; justify-content: space-between; gap: 16px; }
.product-name { margin: 0; font-size: 23px; }
.product-pack { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.price-block { flex: none; text-align: right; }
.price-block span { display: block; color: var(--muted); font-size: 13px; }
.price-block strong { color: var(--orange); font-size: 24px; }
.update-date { margin: 8px 0 14px; color: var(--muted); font-size: 13px; }

.quantity-control {
  display: grid;
  grid-template-columns: 60px 70px 60px;
  align-items: center;
  margin-top: auto;
}

.quantity-button {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 18px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 35px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.quantity-button:active { transform: scale(.94); }
.quantity { text-align: center; font-size: 30px; font-weight: 800; }

.other-item {
  margin-top: 18px;
  padding: 22px;
  border: 1px dashed #bbb3a4;
  border-radius: 22px;
  background: rgba(255, 253, 248, .66);
}
.other-item label { display: block; font-size: 22px; font-weight: 800; }
.other-item p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
textarea, input {
  width: 100%;
  border: 1px solid #bbb5a8;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
}
textarea { resize: vertical; }
textarea:focus, input:focus { outline: 3px solid rgba(31, 106, 76, .18); border-color: var(--green); }

.source-note { margin: 20px 4px; color: var(--muted); font-size: 13px; }
.source-note a { color: var(--green); }

.bottom-bar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(760px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 13px 14px 13px 20px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  background: rgba(30, 34, 30, .94);
  color: white;
  box-shadow: 0 15px 45px rgba(20, 20, 16, .28);
  backdrop-filter: blur(12px);
}
.bottom-bar strong, .bottom-bar span { display: block; }
.bottom-bar span { max-width: 340px; overflow: hidden; color: #ccd0ca; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }

.primary-button, .secondary-button {
  min-height: 54px;
  border-radius: 15px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { border: 0; background: var(--orange); color: white; }
.primary-button:hover { background: #dc592b; }
.primary-button:disabled { cursor: not-allowed; background: #777; color: #ddd; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.full-width { width: 100%; }

.modal {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 30px);
  border: 0;
  border-radius: 26px;
  padding: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(19, 22, 19, .62); backdrop-filter: blur(4px); }
.modal-card { position: relative; margin: 0; overflow-y: auto; border-radius: 26px; background: var(--card); padding: 28px; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 18px; font-size: 30px; }
.close-button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #efede6; font-size: 28px; cursor: pointer; }
.review-list { display: grid; gap: 9px; }
.review-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.review-row strong:last-child { white-space: nowrap; color: var(--green); }
.review-other { white-space: pre-wrap; color: var(--muted); }
.name-field { display: block; margin-top: 20px; }
.name-field span, .share-result label { display: block; margin-bottom: 7px; font-weight: 700; }
.modal-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 22px; }
.send-message { min-height: 24px; margin: 12px 0 0; color: #a4371d; font-size: 14px; }
.success-card { text-align: center; }
.success-mark { display: grid; place-items: center; width: 76px; height: 76px; margin: 4px auto 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 44px; font-weight: 800; }

@media (max-width: 600px) {
  body { font-size: 17px; padding-bottom: 118px; }
  .page-header { padding-top: 28px; }
  .product-card { grid-template-columns: 116px 1fr; min-height: 188px; border-radius: 20px; }
  .product-info { padding: 15px; }
  .product-heading { display: block; }
  .product-name { font-size: 20px; }
  .price-block { margin-top: 5px; text-align: left; }
  .price-block span, .price-block strong { display: inline; }
  .price-block strong { font-size: 22px; }
  .update-date { margin: 4px 0 10px; }
  .quantity-control { grid-template-columns: 55px 58px 55px; }
  .quantity-button { width: 53px; height: 53px; border-radius: 16px; }
  .bottom-bar { gap: 10px; padding-left: 16px; }
  .bottom-bar span { max-width: 145px; }
  .bottom-bar .primary-button { padding-inline: 15px; font-size: 15px; }
  .modal-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .product-card { animation: rise .45s both; }
  .product-card:nth-child(2) { animation-delay: .05s; }
  .product-card:nth-child(3) { animation-delay: .10s; }
  .product-card:nth-child(4) { animation-delay: .15s; }
  .product-card:nth-child(5) { animation-delay: .20s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
}
