:root {
  color-scheme: light;
  --ink: #223027;
  --muted: #6c756d;
  --cream: #f5f2e9;
  --paper: #fffdf8;
  --line: #e1ded3;
  --leaf: #2f6b48;
  --leaf-dark: #214e35;
  --leaf-soft: #dfeadd;
  --lime: #dbe878;
  --orange: #e99550;
  --orange-soft: #f7e3cf;
  --red: #a64232;
  --shadow: 0 18px 50px rgba(47, 69, 52, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -5%, rgba(219, 232, 120, 0.35), transparent 30%),
    linear-gradient(180deg, #faf8f0 0%, var(--cream) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(47, 107, 72, 0.25);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(250, 248, 240, 0.82);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  border-bottom: 1px solid rgba(225, 222, 211, 0.8);
  background: rgba(250, 248, 240, 0.93);
  backdrop-filter: blur(18px);
}

.brand-button,
.quiet-button,
.text-button,
.back-button,
.icon-button,
.bottom-nav button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--leaf-soft);
  font-size: 22px;
}

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

.brand-button strong {
  font-size: 18px;
  letter-spacing: 0.03em;
}

.brand-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.quiet-button {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--leaf-dark);
  background: var(--leaf-soft);
  font-size: 13px;
  font-weight: 700;
}

main {
  min-height: calc(100vh - 72px);
}

.view {
  padding: 22px 18px calc(112px + env(safe-area-inset-bottom));
}

.hero-card,
.season-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(219, 232, 120, 0.26), transparent 35%),
    linear-gradient(145deg, var(--leaf-dark), var(--leaf));
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 34px 26px 30px;
}

.hero-card::after,
.season-card::after {
  position: absolute;
  right: -45px;
  bottom: -68px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.hero-vegetables {
  position: absolute;
  top: 20px;
  right: 22px;
  display: flex;
  gap: 2px;
  transform: rotate(7deg);
  font-size: 28px;
}

.hero-card h1,
.season-card h1,
.page-heading h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: -0.02em;
}

.hero-card h1 {
  max-width: 360px;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.14;
}

.hero-copy {
  max-width: 500px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.75;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card .eyebrow,
.season-card .eyebrow {
  color: var(--lime);
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.form-card,
.basis-card,
.menu-preview,
.review-card,
.profile-card,
.history-item,
.menu-panel-card {
  border: 1px solid rgba(225, 222, 211, 0.9);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(47, 69, 52, 0.055);
}

.form-card {
  padding: 22px 18px;
}

.step-heading,
.section-title-row,
.page-heading,
.review-card,
.basis-row,
.history-head {
  display: flex;
  align-items: center;
}

.step-heading {
  gap: 12px;
  margin-bottom: 18px;
}

.step-heading > span {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--leaf-dark);
  background: var(--lime);
  font-size: 13px;
  font-weight: 900;
}

.step-heading h2,
.section-title-row h2,
.review-card h2,
.sheet-content h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.step-heading p,
.section-title-row p,
.review-card p,
.page-intro,
.dialog-intro,
.panel-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.month-grid,
.choice-grid,
.chip-grid {
  display: grid;
  gap: 9px;
}

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

.choice-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.choice-card,
.month-option,
.preset-option,
.food-chip,
.allergy-chip,
.exclude-chip,
.result-choice {
  position: relative;
}

.choice-card input,
.month-option input,
.preset-option input,
.food-chip input,
.allergy-chip input,
.exclude-chip input,
.result-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.month-option span,
.choice-card span,
.preset-option span,
.food-chip span,
.allergy-chip span,
.exclude-chip span,
.result-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.month-option input:checked + span,
.choice-card input:checked + span,
.preset-option input:checked + span,
.food-chip input:checked + span,
.allergy-chip input:checked + span,
.exclude-chip input:checked + span,
.result-choice input:checked + span {
  border-color: var(--leaf);
  color: var(--leaf-dark);
  background: var(--leaf-soft);
  box-shadow: inset 0 0 0 1px var(--leaf);
}

.month-option span {
  font-weight: 800;
}

.choice-card span {
  flex-direction: column;
  min-height: 82px;
  gap: 5px;
  padding: 10px 5px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.choice-card b {
  font-size: 21px;
}

.field-label {
  display: block;
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.field-label em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

input[type="date"],
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}

.preset-list {
  display: grid;
  gap: 9px;
}

.preset-option span {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 68px;
  padding: 13px 14px;
  text-align: left;
}

.preset-copy {
  display: grid;
  gap: 4px;
}

.preset-copy b {
  font-size: 14px;
}

.preset-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.custom-food-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.food-category + .food-category {
  margin-top: 16px;
}

.food-category h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.food-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.food-chip span,
.allergy-chip span,
.exclude-chip span {
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
}

.chip-grid {
  grid-template-columns: repeat(3, 1fr);
}

.exclude-details {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.exclude-details summary {
  color: var(--leaf-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.exclude-details > div {
  margin-top: 12px;
}

.sticky-action {
  padding: 4px 0;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 52px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--leaf);
  color: #fff;
  background: var(--leaf);
  box-shadow: 0 12px 24px rgba(47, 107, 72, 0.2);
}

.secondary-button {
  border: 1px solid var(--leaf);
  color: var(--leaf-dark);
  background: #fff;
}

.danger-button {
  width: 100%;
  border: 1px solid rgba(166, 66, 50, 0.35);
  color: var(--red);
  background: #fff;
}

.form-error {
  min-height: 18px;
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.season-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 205px;
  padding: 26px 24px;
}

.season-card h1 {
  max-width: 300px;
  font-size: 34px;
  line-height: 1.1;
}

.season-card p:last-child {
  max-width: 360px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.55;
}

.season-illustration {
  position: relative;
  z-index: 1;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px 28px 12px 28px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 46px;
  transform: rotate(4deg);
}

.review-card,
.basis-card,
.menu-preview {
  margin-top: 16px;
}

.review-card {
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-color: rgba(233, 149, 80, 0.28);
  background: var(--orange-soft);
}

.review-card .secondary-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border-color: var(--orange);
  color: #7d4422;
}

.basis-card,
.menu-preview {
  padding: 20px 18px;
}

.section-title-row {
  justify-content: space-between;
  gap: 12px;
}

.text-button {
  padding: 7px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
}

.basis-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.basis-row {
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f5ed;
}

.basis-index {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--leaf-dark);
  background: var(--leaf-soft);
  font-size: 11px;
  font-weight: 900;
}

.basis-row b,
.basis-row small {
  display: block;
}

.basis-row b {
  margin-bottom: 3px;
  font-size: 13px;
}

.basis-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.day-strip {
  display: grid;
  grid-auto-columns: minmax(116px, 1fr);
  grid-auto-flow: column;
  gap: 9px;
  margin: 15px -18px -4px;
  padding: 0 18px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
  display: none;
}

.day-card {
  min-height: 120px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.day-card strong,
.day-card small {
  display: block;
}

.day-card strong {
  margin-bottom: 9px;
  color: var(--leaf-dark);
  font-size: 13px;
}

.day-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.home-actions,
.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.home-actions .secondary-button {
  width: 100%;
}

.safety-note,
.storage-note {
  margin: 18px 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 760px);
  min-height: 72px;
  margin: 0 auto;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(225, 222, 211, 0.9);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bottom-nav button span {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--leaf);
}

.page-heading {
  gap: 12px;
  margin-bottom: 18px;
}

.compact-heading {
  margin-top: 5px;
}

.page-heading h1 {
  font-size: 31px;
}

.back-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: var(--leaf-soft);
  font-size: 31px;
  line-height: 1;
}

.confirmation-lines {
  display: grid;
  gap: 9px;
}

.confirmation-line {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.confirmation-line span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--leaf-dark);
  background: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.confirmation-line b,
.confirmation-line small {
  display: block;
}

.confirmation-line b {
  margin-bottom: 3px;
  font-size: 12px;
}

.confirmation-line small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 18px 0 14px;
  padding: 4px;
  border-radius: 15px;
  background: #e9e6dc;
}

.segmented button {
  min-height: 40px;
  padding: 4px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.segmented button.active {
  color: var(--leaf-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(47, 69, 52, 0.08);
}

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

.menu-day {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.menu-day summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.menu-day summary::-webkit-details-marker {
  display: none;
}

.menu-day summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.meal-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 13px;
}

.meal-card {
  padding: 12px;
  border-radius: 14px;
  background: #f5f3eb;
}

.meal-card strong,
.meal-card small {
  display: block;
}

.meal-card strong {
  font-size: 13px;
  line-height: 1.55;
}

.meal-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.new-badge {
  color: #746f19;
  background: #f0f3b1;
}

.method-list,
.shopping-list,
.observe-list {
  display: grid;
  gap: 10px;
}

.method-item,
.shopping-group,
.observe-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}

.method-item h3,
.shopping-group h3,
.observe-item h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.method-item p,
.shopping-group p,
.observe-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.warning-line {
  margin-top: 8px !important;
  padding: 9px;
  border-radius: 11px;
  color: #7d4422 !important;
  background: var(--orange-soft);
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.history-item {
  padding: 17px;
}

.history-head {
  justify-content: space-between;
  gap: 10px;
}

.history-head h2 {
  margin: 0;
  font-size: 18px;
}

.history-tag {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--leaf-dark);
  background: var(--leaf-soft);
  font-size: 10px;
  font-weight: 800;
}

.history-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.history-item button {
  margin-top: 12px;
}

.empty-card {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.profile-card {
  padding: 20px;
}

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

.profile-stat {
  min-height: 90px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f3eb;
}

.profile-stat small,
.profile-stat strong {
  display: block;
}

.profile-stat small {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.profile-stat strong {
  font-size: 15px;
  line-height: 1.4;
}

.sheet-dialog {
  width: min(100% - 20px, 720px);
  max-height: calc(100vh - 30px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -20px 60px rgba(30, 47, 35, 0.2);
}

.sheet-dialog::backdrop {
  background: rgba(20, 31, 24, 0.48);
  backdrop-filter: blur(5px);
}

.sheet-content {
  max-height: calc(100vh - 30px);
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 15px;
  border-radius: 99px;
  background: #d6d2c7;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #efede5;
  font-size: 24px;
}

.review-item {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
}

.review-item h3 {
  margin: 0 0 11px;
  font-size: 16px;
}

.result-choice-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.result-choice span {
  min-height: 40px;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 680px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100vh - 36px);
    border: 1px solid rgba(225, 222, 211, 0.9);
    border-radius: 32px;
    box-shadow: var(--shadow);
  }

  .topbar {
    top: 18px;
    border-radius: 32px 32px 0 0;
  }

  .bottom-nav {
    bottom: 18px;
    border: 1px solid rgba(225, 222, 211, 0.9);
    border-radius: 22px 22px 32px 32px;
  }

  .view {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 380px) {
  .month-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-vegetables {
    opacity: 0.42;
  }

  .season-illustration {
    width: 64px;
    height: 64px;
    font-size: 36px;
  }
}

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