:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --text: #17211b;
  --muted: #65736b;
  --line: #dfe6dd;
  --green: #237a4b;
  --red: #b13b2e;
  --amber: #d59120;
  --blue: #246b8e;
  --shadow: 0 14px 35px rgba(28, 45, 34, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 22px;
  background: #eaf0e8;
  border-bottom: 1px solid var(--line);
}

.brand-home {
  display: grid;
  gap: 8px;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.brand-home:hover h1,
.brand-home:focus-visible h1 {
  color: var(--green);
}

.last-updated {
  width: max-content;
  padding: 5px 9px;
  border: 1px solid #cfded3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.head-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid #cfded3;
  border-radius: 999px;
  background: #fff;
  color: #26382d;
  box-shadow: 0 12px 28px rgba(28, 45, 34, 0.11);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.head-action:hover,
.head-action:focus-visible {
  border-color: var(--green);
  background: #f8fffa;
  color: var(--green);
}

.head-action::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid #cfded3;
  border-radius: 8px;
  background: #17211b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.head-action:hover::after,
.head-action:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.head-action-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #d8f1dd;
  color: #176b3a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 22px auto 48px;
}

.site-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
  padding: 0 8px;
  text-align: center;
}

.site-intro p {
  margin: 0;
  color: #26382d;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 900;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-bottom: 16px;
}

.deal-section {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #b9dfc0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f2fbf4 0%, #edf8f0 100%);
  box-shadow: 0 18px 45px rgba(28, 45, 34, 0.1);
}

.deal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.deal-head h2 {
  margin: 0;
  font-size: 22px;
}

.deal-description {
  max-width: 640px;
  margin: 0;
  color: #125f35;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
}

.deal-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  gap: 10px;
}

.deal-threshold {
  display: grid;
  grid-template-columns: auto 96px;
  align-items: center;
  gap: 10px;
}

.deal-threshold span {
  color: #405247;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.deal-threshold select {
  min-height: 34px;
  padding: 6px 30px 6px 10px;
}

.deal-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.deal-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 94px;
  padding: 11px 14px;
  border: 1px solid #a7d6b0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(28, 45, 34, 0.06);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.deal-card:hover {
  border-color: var(--green);
  box-shadow: 0 18px 36px rgba(28, 45, 34, 0.12);
  transform: translateY(-1px);
}

.deal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.deal-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #121c16;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.18;
}

.deal-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.deal-price-main {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.deal-price {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

.deal-unit {
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.deal-discount {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 12px;
  color: #176b3a;
  background: linear-gradient(180deg, #d9f5df 0%, #c7edd2 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 58, 0.08);
}

.deal-discount-value {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

.deal-discount-label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: #26382d;
  font-size: 12px;
  font-weight: 700;
}

.deal-empty {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

button {
  cursor: pointer;
}

.stat-label,
.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fruit-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.fruit-card.good {
  border-color: #79bd8d;
  background: linear-gradient(180deg, #f3fbf1 0, #ffffff 210px);
}

.fruit-card.high {
  border-color: #e2aaa0;
  background: linear-gradient(180deg, #fff5f2 0, #ffffff 210px);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(144px, 42%) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fruit-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f6f1;
}

.fruit-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summary-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.summary-box {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.title-box {
  align-content: start;
  min-height: 94px;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
  color: #101813;
  overflow-wrap: anywhere;
}

.markets {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-box strong {
  display: block;
  color: var(--blue);
  font-size: 23px;
  line-height: 1.1;
}

.summary-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-box .label,
.retail-box .label,
.history-head .label {
  color: #405247;
  font-size: 14px;
  font-weight: 900;
}

.retail-box {
  display: block;
  min-width: 0;
  padding: 16px;
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fruit-card.delta-good .retail-box {
  background: #eef9f0;
  border-color: #7fbd8e;
}

.fruit-card.delta-high .retail-box {
  background: #fff2ef;
  border-color: #df9b90;
}

.fruit-card.delta-neutral .retail-box {
  background: #f7faf8;
  border-color: #cfded3;
}

.retail-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 6px;
}

.retail-box strong {
  display: inline-block;
  color: var(--blue);
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.1;
  white-space: nowrap;
}

.retail-delta {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef4ef;
  font-size: 13px;
  font-weight: 800;
}

.fruit-card.delta-good .retail-delta {
  color: #176b3a;
  background: #d8f1dd;
}

.fruit-card.delta-high .retail-delta {
  color: #a33427;
  background: #ffe0da;
}

.fruit-card.delta-neutral .retail-delta {
  color: #526158;
  background: #edf2ee;
}

.retail-box small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.price-source {
  width: fit-content;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.price-source:hover {
  text-decoration: underline;
}

.history-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-unit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.history {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.history-price {
  display: grid;
  align-content: center;
  gap: 2px;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 6px 3px;
  border: 1px solid #dbe5dc;
  border-radius: 6px;
  background: #ffffff;
  color: #243228;
  text-align: center;
  white-space: nowrap;
}

.history-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.history-price strong {
  font-size: 13px;
  line-height: 1.1;
}

.history-price.missing {
  color: var(--muted);
  background: #f2f5f1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.info-button {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
  font-weight: 800;
}

.info-button:hover {
  background: #1d683f;
}

.info-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(20, 35, 27, 0.28);
}

.info-dialog::backdrop {
  background: rgba(18, 28, 22, 0.46);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 24px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  background: #f4f7f2;
  font-size: 24px;
  line-height: 1;
}

.dialog-content {
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.info-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-summary div,
.dialog-content section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.info-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px;
}

.nutrition-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nutrition-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.price-table {
  display: grid;
  grid-template-columns: repeat(7, minmax(64px, 1fr));
  gap: 8px;
}

.price-table div {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.price-table span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-table strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.dialog-content h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.dialog-content ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.dialog-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.retail-note {
  margin-top: 8px !important;
  font-size: 13px;
}

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 18px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 30px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer section {
  min-width: 0;
}

.site-footer h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.site-footer a {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.support-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(35, 122, 75, 0.11), transparent 38%),
    linear-gradient(315deg, rgba(213, 145, 32, 0.13), transparent 42%),
    var(--bg);
}

.support-topbar {
  align-items: center;
  justify-content: flex-end;
}

.support-topbar .header-tools {
  align-items: center;
  justify-content: flex-end;
}

.support-topbar .head-action {
  min-height: 60px;
  padding: 8px 18px 8px 8px;
  font-size: 16px;
}

.support-topbar .head-action-icon {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.support-main {
  display: grid;
  place-items: start center;
  width: min(1160px, calc(100% - 32px));
  margin-top: clamp(28px, 7vw, 76px);
}

.support-panel {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: clamp(18px, 4vw, 34px);
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.support-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
}

.support-copy h2 {
  margin: 0;
  font-size: clamp(36px, 4.3vw, 56px);
  line-height: 1.05;
}

.support-copy h2 span {
  display: block;
}

.support-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  font-weight: 800;
}

.support-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.support-option {
  display: grid;
  align-content: space-between;
  gap: 16px;
  min-height: 240px;
  padding: 22px;
  border: 1px solid #cfded3;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 20px 45px rgba(28, 45, 34, 0.09);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.support-option:hover,
.support-option:focus-visible {
  border-color: var(--green);
  box-shadow: 0 24px 54px rgba(28, 45, 34, 0.14);
  transform: translateY(-2px);
}

.support-option[aria-disabled="true"] {
  opacity: 0.74;
  cursor: not-allowed;
}

.support-option strong {
  display: block;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

.support-option small {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.support-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #237a4b;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.custom-support {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf5;
}

.custom-support label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.custom-support input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #cfded3;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.support-submit {
  align-self: end;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 900;
}

.support-methods {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.support-methods h3 {
  margin: 0;
  font-size: 16px;
}

.fallback-method-list {
  display: grid;
  gap: 10px;
}

.fallback-method {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px dashed #cfded3;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.fallback-method strong {
  font-size: 15px;
}

.fallback-method span,
.support-notice {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.support-notice {
  margin: 14px 0 0;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    align-items: start;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .head-action::after {
    right: auto;
    left: 0;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .deal-head {
    display: grid;
    align-items: start;
  }

  .deal-tools {
    width: 100%;
    justify-content: space-between;
  }

  .deal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .info-summary {
    grid-template-columns: 1fr;
  }

  .price-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .support-panel {
    grid-template-columns: 1fr;
  }

  .support-copy {
    min-height: auto;
  }

  .support-options,
  .custom-support {
    grid-template-columns: 1fr;
  }

  .support-option {
    min-height: 160px;
  }
}

@media (max-width: 560px) {
  .card-top {
    grid-template-columns: 1fr;
  }

  .deal-price-row {
    display: flex;
    gap: 4px;
  }

  .retail-box {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .retail-box small {
    white-space: normal;
  }

  .card-foot {
    display: grid;
  }

  .deal-list {
    grid-template-columns: 1fr;
  }
}
