:root {
  --ink: #18322c;
  --muted: #6f807a;
  --green: #0e604d;
  --green-deep: #084c3c;
  --green-soft: #e4f0e9;
  --mint: #f0f6f1;
  --cream: #f7f4eb;
  --paper: #fffdf8;
  --line: #dce5df;
  --orange: #e7724d;
  --orange-soft: #fff0e8;
  --amber: #a86b18;
  --amber-soft: #fff5dd;
  --red: #bc4d41;
  --red-soft: #fff0ed;
  --shadow: 0 18px 60px rgba(34, 67, 58, 0.09);
  --shadow-small: 0 8px 26px rgba(31, 65, 55, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --content-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 3%, rgba(194, 225, 207, 0.72), transparent 25rem),
    radial-gradient(circle at 95% 20%, rgba(248, 218, 181, 0.48), transparent 24rem),
    #f6f5ef;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(14, 96, 77, 0.28);
  outline-offset: 3px;
}

svg {
  display: block;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(5px);
}

.ambient-one {
  top: 12%;
  left: -180px;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(14, 96, 77, 0.1);
}

.ambient-two {
  right: -120px;
  bottom: 16%;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(231, 114, 77, 0.13);
}

.app-shell {
  width: min(100%, var(--content-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px 128px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(
    180deg,
    rgba(246, 245, 239, 0.97) 0%,
    rgba(246, 245, 239, 0.88) 72%,
    rgba(246, 245, 239, 0) 100%
  );
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  color: var(--cream);
  border-radius: 14px;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(14, 96, 77, 0.22);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(14, 96, 77, 0.12);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.82);
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saved-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  color: white;
  border: 2px solid #f6f5ef;
  border-radius: 10px;
  background: var(--orange);
  font-size: 9px;
  font-weight: 700;
}

.saved-count:empty {
  display: none;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
  animation: page-in 0.36s ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hero {
  position: relative;
  padding: 34px 6px 20px;
}

.eyebrow,
.section-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45a17a;
  box-shadow: 0 0 0 5px rgba(69, 161, 122, 0.12);
}

.hero h1,
.subpage-heading h1 {
  margin: 18px 0 14px;
  font-family: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(42px, 9.5vw, 68px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero h1 em {
  color: var(--green);
  font-style: normal;
}

.hero-copy {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 22px;
}

.trust-row span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #3f5e55;
  font-size: 11px;
  font-weight: 600;
}

.trust-row svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-card {
  position: relative;
  padding: 24px;
  border: 1px solid rgba(20, 92, 73, 0.08);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 247, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-card::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 190px;
  height: 190px;
  border: 30px solid rgba(162, 202, 178, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.search-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.search-heading h2,
.results-heading h2 {
  margin: 4px 0 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.text-button {
  padding: 5px 0;
  color: var(--muted);
  border: 0;
  border-bottom: 1px solid #a8b8b2;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.query-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 8px 9px 8px 18px;
  border: 1px solid #e0e9e3;
  border-radius: 20px;
  background: #fbfdfb;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.query-box:focus-within {
  border-color: rgba(14, 96, 77, 0.45);
  box-shadow: 0 0 0 4px rgba(14, 96, 77, 0.07);
}

.query-box > svg {
  width: 22px;
  fill: none;
  stroke: #6a7e77;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.query-box input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.query-box input::placeholder {
  color: #8b9995;
}

.query-box button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: white;
  border: 0;
  border-radius: 15px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(14, 96, 77, 0.22);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.query-box button:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
}

.query-box button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-block {
  position: relative;
  z-index: 1;
  margin-top: 22px;
}

.filter-block.compact {
  margin-top: 18px;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}

.filter-title small {
  color: #94a09c;
  font-size: 10px;
  font-weight: 400;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px 7px 8px;
  color: #536761;
  border: 1px solid #dfe7e2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.filter-chip:hover {
  border-color: #9fbfaf;
  transform: translateY(-1px);
}

.filter-chip[aria-pressed="true"] {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.chip-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--green);
  border-radius: 50%;
  background: var(--green-soft);
  font-family: serif;
  font-size: 10px;
  font-weight: 700;
}

.filter-chip[data-allergen="milk"] .chip-icon {
  background: #e7f2fa;
}

.filter-chip[data-allergen="egg"] .chip-icon {
  color: #9b7616;
  background: #fff2c8;
}

.filter-chip[data-allergen="gluten"] .chip-icon {
  color: #8a5d28;
  background: #f4e7d7;
}

.filter-chip[data-allergen="peanut"] .chip-icon {
  color: #8c5b22;
  background: #efe1c8;
}

.filter-chip[data-allergen="soy"] .chip-icon {
  color: #5d7533;
  background: #e9f0da;
}

.filter-chip[data-allergen="nuts"] .chip-icon {
  color: #825032;
  background: #f4e3d7;
}

.filter-chip[data-allergen="fish"] .chip-icon {
  color: #407188;
  background: #e0eff3;
}

.filter-chip[data-allergen="crustaceans"] .chip-icon {
  color: #ab513d;
  background: #fde6df;
}

.filter-chip[aria-pressed="true"] .chip-icon {
  color: var(--green-deep);
  background: white;
}

.nutrition-grid .filter-chip {
  padding: 7px 14px 7px 8px;
}

.age-grid .filter-chip {
  padding-right: 14px;
}

.age-grid .filter-chip[aria-pressed="true"] {
  color: var(--green-deep);
  border-color: #b9d2c3;
  background: #e6f2ea;
}

.age-note {
  margin: 9px 0 0;
  color: #93a09b;
  font-size: 9px;
  line-height: 1.55;
}

.detail-age-note {
  margin-top: 10px;
  padding: 0 3px;
}

.trace-toggle {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px dashed #d9e3dc;
}

.trace-toggle strong,
.trace-toggle span {
  display: block;
}

.trace-toggle strong {
  font-size: 12px;
}

.trace-toggle > div > span {
  margin-top: 4px;
  color: #93a09b;
  font-size: 10px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 25px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch > span:not(.sr-only) {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d4dfd8;
  transition: background 0.2s ease;
}

.switch > span:not(.sr-only)::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px rgba(33, 58, 51, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(19px);
}

.results-section {
  margin-top: 40px;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.results-heading h2 em {
  color: var(--orange);
  font-style: normal;
}

.sort-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 8px 8px;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.sort-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.active-filter-bar {
  display: flex;
  gap: 7px;
  margin: 16px 4px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-filter-bar::-webkit-scrollbar,
.category-scroller::-webkit-scrollbar {
  display: none;
}

.applied-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px 10px;
  color: var(--green);
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 10px;
}

.applied-filter b {
  font-weight: 700;
}

.category-scroller {
  display: flex;
  gap: 8px;
  margin: 18px -18px 16px;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-chip {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 7px 16px;
  color: #677872;
  border: 1px solid #dce4df;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  font-size: 11px;
  cursor: pointer;
}

.category-chip.is-active {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

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

.product-card {
  position: relative;
  min-width: 0;
  padding: 9px 9px 14px;
  border: 1px solid rgba(33, 72, 59, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  animation: card-in 0.4s ease both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 96, 77, 0.16);
  box-shadow: 0 14px 34px rgba(31, 65, 55, 0.12);
}

.product-image-wrap {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1.05;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 90%, rgba(210, 229, 215, 0.68), transparent 55%),
    #f3f4ed;
  overflow: hidden;
}

.product-image-wrap img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 12px 11px rgba(31, 50, 44, 0.1));
  transition: transform 0.35s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.035);
}

.save-button {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 5px 14px rgba(30, 57, 49, 0.08);
  backdrop-filter: blur(7px);
  cursor: pointer;
}

.save-button svg {
  width: 16px;
  fill: none;
  stroke: #61756e;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.save-button.is-saved svg {
  fill: var(--orange);
  stroke: var(--orange);
}

.quality-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  color: #516961;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.product-info {
  padding: 13px 3px 0;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #899791;
  font-size: 9px;
}

.product-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #adbbb5;
}

.product-name {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  font-family: "STSong", "Songti SC", serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-size {
  margin: 6px 0 9px;
  color: #8b9894;
  font-size: 10px;
}

.risk-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-top: 9px;
  color: #6d7d78;
  border-top: 1px solid #edf0ed;
  font-size: 9px;
  line-height: 1.45;
}

.risk-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: #5da382;
  box-shadow: 0 0 0 3px rgba(93, 163, 130, 0.1);
}

.risk-line.has-risk {
  color: #9a5745;
}

.risk-line.has-risk .risk-dot {
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(231, 114, 77, 0.1);
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
  min-height: 20px;
}

.mini-tag {
  padding: 4px 7px;
  color: #4e6e63;
  border-radius: 6px;
  background: #edf4ef;
  font-size: 8px;
  line-height: 1;
}

.mini-tag.warn {
  color: #98513d;
  background: var(--orange-soft);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: #e8f1ea;
}

.empty-illustration span {
  position: absolute;
  inset: 13px;
  border: 1px dashed #a8c1b3;
  border-radius: 50%;
}

.empty-illustration svg {
  width: 56px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-illustration.simple {
  background: #f1eee2;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 22px;
}

.empty-state p {
  max-width: 290px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.primary-outline {
  padding: 11px 20px;
  color: var(--green);
  border: 1px solid rgba(14, 96, 77, 0.28);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 32px), 430px);
  min-height: 67px;
  padding: 7px;
  border: 1px solid rgba(25, 68, 55, 0.1);
  border-radius: 23px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 15px 40px rgba(30, 57, 49, 0.17);
  backdrop-filter: blur(18px);
  transform: translateX(50%);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  color: #8b9994;
  border: 0;
  border-radius: 17px;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.nav-item i {
  position: absolute;
  top: 9px;
  right: calc(50% - 14px);
  width: 5px;
  height: 5px;
  border: 1px solid white;
  border-radius: 50%;
  background: var(--orange);
}

.subpage-heading {
  padding: 40px 5px 20px;
}

.subpage-heading h1 {
  margin-top: 12px;
  font-size: clamp(36px, 8vw, 56px);
}

.subpage-heading p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.saved-grid {
  margin-top: 12px;
}

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

.guide-card {
  position: relative;
  min-height: 148px;
  padding: 18px;
  border: 1px solid rgba(25, 68, 55, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-small);
  overflow: hidden;
}

.guide-card::after {
  content: attr(data-letter);
  position: absolute;
  right: 8px;
  bottom: -24px;
  color: rgba(14, 96, 77, 0.055);
  font-family: Georgia, serif;
  font-size: 82px;
  line-height: 1;
}

.guide-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--green);
  border-radius: 11px;
  background: var(--green-soft);
  font-family: "STSong", "Songti SC", serif;
  font-weight: 700;
}

.guide-card h3 {
  margin: 0 0 8px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 18px;
}

.guide-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.guide-note,
.source-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.scan-card {
  padding: 20px;
  border: 1px solid rgba(25, 68, 55, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.scan-dropzone {
  display: flex;
  min-height: 260px;
  padding: 30px 20px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 1px dashed #b8cec0;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 100%, rgba(188, 220, 201, 0.42), transparent 55%),
    #fbfdf9;
  text-align: center;
}

.scan-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--green);
  border-radius: 20px;
  background: var(--green-soft);
}

.scan-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-dropzone h2 {
  margin: 0 0 8px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 22px;
}

.scan-dropzone p {
  max-width: 360px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.primary-button {
  min-height: 42px;
  padding: 10px 18px;
  color: white;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(14, 96, 77, 0.18);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button.wide {
  width: 100%;
  margin-top: 12px;
}

.sample-photo-button {
  margin-top: 14px;
}

.ocr-preview {
  position: relative;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #edf1ea;
  overflow: hidden;
}

.ocr-preview img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.ocr-preview button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 7px 11px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 9px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.ocr-progress {
  margin: 0 0 18px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--green-soft);
}

.ocr-progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--green);
  font-size: 10px;
}

.ocr-progress-track {
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(14, 96, 77, 0.12);
  overflow: hidden;
}

.ocr-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67a986, var(--green));
  transition: width 0.2s ease;
}

.ocr-editor {
  margin-top: 18px;
}

.ocr-editor textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  color: var(--ink);
  border: 1px solid #dce6e0;
  border-radius: 15px;
  outline: 0;
  background: #fbfdfb;
  font: 12px/1.75 "PingFang SC", "Microsoft YaHei", sans-serif;
  resize: vertical;
}

.ocr-editor textarea:focus {
  border-color: rgba(14, 96, 77, 0.45);
  box-shadow: 0 0 0 4px rgba(14, 96, 77, 0.07);
}

.ocr-result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: #f8faf6;
}

.ocr-result h3 {
  margin: 0 0 6px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 19px;
}

.ocr-result > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.guide-note {
  color: #785136;
  background: #fff3df;
}

.note-number {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(120, 81, 54, 0.25);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.guide-note h3,
.source-card h3 {
  margin: 0 0 7px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 17px;
}

.guide-note p,
.source-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
}

.source-card {
  display: block;
  border: 1px solid rgba(14, 96, 77, 0.1);
  background: rgba(255, 253, 248, 0.7);
}

.source-card p {
  margin: 12px 0 16px;
  color: var(--muted);
}

.source-card .data-quality-summary {
  padding: 12px 14px;
  color: var(--green);
  border-radius: 12px;
  background: var(--green-soft);
  font-weight: 600;
}

.source-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.source-card a svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-dialog {
  width: min(100%, 680px);
  max-width: none;
  height: min(90vh, 920px);
  max-height: none;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 30px 30px 0 0;
  background: transparent;
  overflow: visible;
}

.product-dialog::backdrop {
  background: rgba(11, 31, 25, 0.5);
  backdrop-filter: blur(4px);
}

.dialog-sheet {
  position: relative;
  height: 100%;
  padding: 14px 20px 56px;
  border-radius: 30px 30px 0 0;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: sheet-in 0.28s ease both;
}

@keyframes sheet-in {
  from {
    transform: translateY(30px);
    opacity: 0.4;
  }
}

.dialog-grabber {
  width: 42px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 4px;
  background: #d3dbd7;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 17px;
  right: 18px;
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid #e0e7e2;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.dialog-close svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.detail-hero {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 12px 0 22px;
}

.detail-image {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 22px;
  background: #eff2eb;
  overflow: hidden;
}

.detail-image img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(32, 57, 49, 0.1));
}

.detail-brand {
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.detail-title {
  margin: 7px 0 6px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 25px;
  line-height: 1.28;
}

.detail-meta {
  color: var(--muted);
  font-size: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.detail-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid #dce6e0;
  border-radius: 999px;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.detail-actions button.is-saved {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.detail-actions svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.detail-warning {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 13px 14px;
  color: #825535;
  border-radius: 14px;
  background: #fff2df;
  font-size: 10px;
  line-height: 1.6;
}

.detail-warning svg {
  flex: 0 0 auto;
  width: 17px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.detail-section {
  padding: 19px 0;
  border-top: 1px solid #e9eee9;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.detail-section-heading h3 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 18px;
}

.detail-section-heading span {
  color: #95a19d;
  font-size: 9px;
}

.ingredient-copy {
  margin: 0;
  color: #415c54;
  font-size: 12px;
  line-height: 1.85;
}

.ingredient-copy mark {
  padding: 1px 2px;
  color: #994b39;
  border-radius: 3px;
  background: #ffe4da;
}

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

.allergen-summary.single {
  grid-template-columns: minmax(0, 1fr);
}

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

.allergen-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #e1e8e3;
  border-radius: 13px;
  background: #fbfcfa;
}

.allergen-cell span {
  color: #5f726b;
  font-size: 11px;
}

.allergen-cell strong {
  color: #81908a;
  font-size: 10px;
  font-weight: 700;
}

.allergen-cell small {
  grid-column: 1 / -1;
  color: #8d9a95;
  font-size: 8px;
  line-height: 1.35;
}

.allergen-cell.is-direct {
  border-color: #efc7bb;
  background: var(--orange-soft);
}

.allergen-cell.is-direct strong {
  color: var(--red);
}

.allergen-cell.is-trace {
  border-color: #edd8b5;
  background: var(--amber-soft);
}

.allergen-cell.is-trace strong {
  color: #99651d;
}

.allergen-cell.is-pending {
  border-color: #e6dfd1;
  background: #f6f3eb;
}

.allergen-cell.is-pending strong {
  color: #8c7755;
}

.allergen-rule {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #e4eae6;
  border-radius: 13px;
  background: #fbfcfa;
}

.allergen-rule summary {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.allergen-rule p {
  margin: 9px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.allergen-rule dl {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 6px 9px;
  margin: 0;
  color: #6e8079;
  font-size: 9px;
  line-height: 1.55;
}

.allergen-rule dt {
  font-weight: 700;
}

.allergen-rule dd {
  margin: 0;
}

.allergen-box {
  padding: 13px;
  border: 1px solid #e2e9e4;
  border-radius: 15px;
  background: #fafcf9;
}

.allergen-box.warning {
  border-color: #f2d5c9;
  background: var(--orange-soft);
}

.allergen-box.trace {
  border-color: #efdbb9;
  background: var(--amber-soft);
}

.allergen-box.safe {
  border-color: #d4e5da;
  background: #f1f7f2;
}

.allergen-box small,
.allergen-box strong {
  display: block;
}

.allergen-box small {
  margin-bottom: 5px;
  color: #8b9a94;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.allergen-box strong {
  font-size: 11px;
  line-height: 1.5;
}

.nutrition-list {
  display: grid;
  gap: 12px;
}

.nutrition-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 11px;
}

.nutrition-row > span:first-child {
  color: #647771;
  font-size: 10px;
}

.nutrition-track {
  height: 7px;
  border-radius: 999px;
  background: #ebefec;
  overflow: hidden;
}

.nutrition-track i {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #81b89e, #e2b15b, #e47b56);
}

.nutrition-row strong {
  text-align: right;
  font-size: 10px;
  font-weight: 600;
}

.nutrition-empty {
  color: var(--muted);
  font-size: 11px;
}

.source-box {
  padding: 14px;
  border: 1px solid #e3e9e5;
  border-radius: 15px;
  background: #fafbf8;
}

.source-box dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.source-box dt {
  color: #8d9a96;
}

.source-box dd {
  margin: 0;
  color: #50665f;
  overflow-wrap: anywhere;
}

.source-box a {
  color: var(--green);
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 96px;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  color: white;
  border-radius: 999px;
  background: rgba(22, 47, 40, 0.92);
  box-shadow: 0 8px 25px rgba(17, 38, 32, 0.24);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 30px;
  }

  .topbar {
    height: 88px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero h1 {
    max-width: 720px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .search-card {
    padding: 30px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .category-scroller {
    margin-inline: 0;
    padding-inline: 0;
  }

  .guide-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-dialog {
    margin: auto;
    border-radius: 28px;
  }

  .dialog-sheet {
    padding: 18px 30px 50px;
    border-radius: 28px;
  }

  .detail-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .allergen-matrix {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    bottom: 22px;
  }
}

@media (min-width: 1040px) {
  .app-shell {
    padding-bottom: 90px;
  }

  .hero {
    padding-top: 64px;
  }

  .hero h1 {
    font-size: 72px;
  }

  .search-card {
    padding: 34px;
  }

  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    width: 390px;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-inline: 14px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .search-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .search-heading h2 {
    font-size: 21px;
  }

  .query-box {
    grid-template-columns: 20px minmax(0, 1fr) 44px;
    padding-left: 14px;
  }

  .query-box button {
    width: 42px;
    height: 42px;
  }

  .filter-chip {
    min-height: 36px;
    padding-right: 11px;
    font-size: 11px;
  }

  .chip-icon {
    width: 23px;
    height: 23px;
  }

  .product-grid {
    gap: 10px;
  }

  .product-card {
    padding: 7px 7px 12px;
    border-radius: 19px;
  }

  .product-name {
    font-size: 15px;
  }

  .category-scroller {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .detail-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
  }

  .detail-title {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
