:root {
  --green: #3C6934;
  --green-dark: #033620;
  --green-light: #70A848;
  --yellow: #F0D050;
  --blue: #A0D8E0;
  --cream: #FBF7EA;
  --paper: #FFFFFF;
  --ink: #23301F;
  --muted: #6B7566;
  --line: #E6E1CF;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 測試站提示條 */
.test-bar { background: var(--green-dark); color: #fff; text-align: center; font-size: 14px; padding: 6px 12px; }

/* 頁首 */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.site-header .logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 22px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--green-dark); }
.nav a:hover { color: var(--green-light); }
.cart-link { position: relative; background: var(--yellow); padding: 8px 18px; border-radius: 999px; }
.cart-link .badge {
  position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px;
  background: var(--green-dark); color: #fff; border-radius: 999px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.cart-link .badge[hidden] { display: none; }

/* 首頁主視覺 */
.hero {
  background: radial-gradient(ellipse at 0% 100%, #275137, transparent 65%), #082b1d;
  color: #fff9e9;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: 1240px;
  padding: 40px clamp(20px, 4vw, 48px);
}
.hero-category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #e2edda;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.hero-category::before { content: ""; width: 20px; height: 2px; background: var(--yellow); }
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.875rem, 3.55vw, 3.35rem);
  line-height: 1.22;
  letter-spacing: -.035em;
}
.hero h1 em { color: #ffe278; font-style: normal; }
.hero-description { margin: 0 0 26px; color: #e2edda; font-size: clamp(1rem, 1.6vw, 1.13rem); max-width: 27em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.hero .hero-start { background: #ffe278; color: #14341e; padding: 12px 23px; }
.hero .hero-start:hover { background: #fff1a9; }
.hero-browse { font-size: .95rem; font-weight: 650; text-underline-offset: 5px; padding-block: 10px; }
.hero-browse:hover { color: #ffe278; }
.hero a:focus-visible { outline: 3px solid #fff1a9; outline-offset: 4px; }

.hero-showcase {
  display: grid;
  position: relative;
  isolation: isolate;
  align-items: end;
  min-height: clamp(320px, 34vw, 430px);
  overflow: hidden;
  border-radius: 24px;
  background: #405d32;
}
.hero-field, .hero-showcase::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-field { object-fit: cover; object-position: 53% center; z-index: -2; }
.hero-showcase::after {
  content: "";
  z-index: -1;
  background: linear-gradient(180deg, transparent 32%, rgb(5 25 17 / 45%) 74%, rgb(5 25 17 / 90%));
}
.hero-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.4vw, 18px);
  width: min(100%, 486px);
  margin: 0 auto;
  padding: 36px clamp(12px, 3vw, 32px) 18px;
  list-style: none;
  text-align: center;
}
.hero-products li { align-self: end; }
.hero-products a {
  display: grid;
  justify-items: center;
  border-radius: 12px;
  padding: 8px 2px 6px;
  color: #fff9e9;
  text-decoration: none;
}
.hero-products img {
  width: auto;
  height: clamp(120px, 17vw, 212px);
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 11px 9px rgb(0 0 0 / 60%));
  transition: transform .18s ease;
}
.hero-products li:nth-child(2) img { height: clamp(136px, 19vw, 236px); }
.hero-products span { font-size: .875rem; color: #ffe278; }
.hero-products strong { font-size: 1rem; }
.hero-products a:hover strong, .hero-products a:focus-visible strong { text-decoration: underline; text-underline-offset: 4px; }
.hero-products a:hover img { transform: translateY(-5px); }
#stages, #products { scroll-margin-top: 68px; }

@media (prefers-reduced-motion: reduce) {
  .hero-products img { transition: none; }
  .hero-products a:hover img { transform: none; }
}

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 700;
  background: var(--green); color: #fff; padding: 14px 30px; border-radius: 999px; transition: transform .15s, background .15s;
}
.btn:hover { background: var(--green-dark); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.btn.ghost:hover { background: var(--green); color: #fff; }
.btn.block { display: block; width: 100%; text-align: center; }

/* 區塊 */
section { padding: 64px 0; }
.section-title { font-size: clamp(26px, 4vw, 36px); color: var(--green-dark); margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 36px; }
.band { background: var(--green); color: #fff; }
.band .section-title { color: #fff; }
.band .section-sub { color: #DDEBD5; }

/* 階段選擇卡 */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stage-card {
  display: block; text-decoration: none; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 26px 24px; transition: transform .15s;
}
.stage-card:hover { transform: translateY(-6px) rotate(-1deg); }
.stage-card .num { display: inline-block; background: var(--yellow); color: var(--green-dark); font-weight: 800; border-radius: 999px; padding: 2px 14px; font-size: 14px; }
.stage-card h3 { margin: 12px 0 4px; font-size: 22px; color: var(--green-dark); }
.stage-card p { margin: 0; color: var(--muted); font-size: 15px; }
.stage-card .go { display: block; margin-top: 14px; font-weight: 700; color: var(--green); }

/* 商品卡 */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.product-card .pic { background: linear-gradient(160deg, #EAF4DC, #FFF6CF); padding: 28px; display: flex; justify-content: center; text-decoration: none; }
.product-card .pic img { height: 240px; width: auto; transition: transform .2s; }
.product-card:hover .pic img { transform: scale(1.06) rotate(2deg); }
.product-card .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: 22px; color: var(--green-dark); }
.product-card h3 a { text-decoration: none; }
.product-card .tag { color: var(--green); font-weight: 600; }
.product-card .meta { color: var(--muted); font-size: 14px; }
.product-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.price { font-size: 24px; font-weight: 800; color: var(--green-dark); }
.btn.small { padding: 10px 20px; font-size: 15px; }

/* 承諾列 */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promise { background: var(--paper); border: 1px dashed var(--green-light); border-radius: var(--radius); padding: 22px; }
.promise h3 { margin: 0 0 6px; color: var(--green-dark); font-size: 19px; }
.promise p { margin: 0; color: var(--muted); font-size: 15px; }

/* 商品內頁 */
.detail { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.detail .pic { background: linear-gradient(160deg, #EAF4DC, #FFF6CF); border-radius: var(--radius); padding: 40px; display: flex; justify-content: center; position: sticky; top: 92px; }
.detail .pic img { height: 380px; width: auto; }
.detail h1 { margin: 0; font-size: 36px; color: var(--green-dark); }
.detail .tag { font-size: 20px; color: var(--green); font-weight: 700; margin: 4px 0 12px; }
.spec { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.spec th, .spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { width: 7em; color: var(--muted); font-weight: 600; }
.detail ul { padding-left: 1.2em; margin: 8px 0 18px; }
.detail h2 { font-size: 20px; color: var(--green-dark); margin: 26px 0 4px; }
.buy-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--green); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: none; font: inherit; font-size: 20px; width: 42px; height: 42px; cursor: pointer; color: var(--green-dark); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 20px; }

/* 購物車 */
.cart-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { height: 90px; width: auto; margin: 0 auto; }
.cart-item .name { font-weight: 700; color: var(--green-dark); }
.cart-item .right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row.total { font-size: 22px; font-weight: 800; color: var(--green-dark); border-top: 2px solid var(--green); margin-top: 10px; padding-top: 14px; }
.hint { font-size: 14px; color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field select {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--green-light); border-color: var(--green-light); }
.notice { background: #FFF6CF; border-radius: 14px; padding: 14px 16px; font-size: 14px; margin-top: 14px; }

/* 頁尾 */
.site-footer { background: var(--green-dark); color: #DDEBD5; padding: 40px 0; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer strong { color: #fff; font-size: 17px; }

/* 提示泡泡 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--green-dark); color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 600; transition: all .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 手機版 */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; max-width: 640px; padding-block: 28px 20px; }
  .hero h1 { font-size: clamp(1.75rem, 7.2vw, 3.35rem); }
  .hero-category { margin-bottom: 10px; }
  .hero-description { margin-bottom: 17px; }
  .hero-showcase { min-height: clamp(254px, 57vw, 340px); border-radius: 18px; }
  .hero-products { padding: 21px 12px 10px; }
  .hero-products img { height: clamp(118px, 35vw, 185px); margin-bottom: 6px; }
  .hero-products li:nth-child(2) img { height: clamp(134px, 40vw, 208px); }
  .stages, .products, .promises, .detail, .cart-layout { grid-template-columns: 1fr; }
  .detail .pic { position: static; }
  .detail .pic img { height: 280px; }
  .nav { gap: 14px; font-size: 15px; }
  .nav .hide-mobile { display: none; }
  section { padding: 44px 0; }
}
