:root {
  color-scheme: light;
  --ink: #2d2730;
  --muted: #756a73;
  --line: #eadfe4;
  --paper: #fffdf8;
  --peach: #ffd7bd;
  --pink: #ff9fc1;
  --mint: #9be6cf;
  --lemon: #ffe57a;
  --sky: #9bd8ff;
  --lavender: #c5b9ff;
  --shadow: 0 14px 34px rgba(82, 57, 76, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 249, 235, 0.96), rgba(245, 255, 250, 0.95)),
    repeating-linear-gradient(90deg, rgba(255, 159, 193, 0.1) 0 1px, transparent 1px 36px);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 168px;
  padding: 28px;
  border: 2px solid #fff;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 215, 189, 0.72), rgba(155, 230, 207, 0.48)),
    var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-heading p {
  margin: 0 0 8px;
  color: #a35a71;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 2.6rem, 2.6rem);
  line-height: 1.08;
}

.subtitle {
  max-width: 610px;
  margin: 12px 0 0;
  color: #5f535d;
  font-size: 1rem;
  line-height: 1.7;
}

.primary-button,
.ghost-button,
.scene-chip,
.ingredient-card {
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.notice {
  min-height: 44px;
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid #f2d0dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.notice.is-active {
  border-color: #ff9fc1;
  background: #fff7fb;
  color: #7b364e;
}

.panel,
.mixer-stage,
.results-section,
.guide-section {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.section-heading h2,
.block-title h3 {
  margin: 0;
}

.section-heading h2 {
  font-size: 1.28rem;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}

.result-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff3b7;
  color: #683548;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--mint);
  white-space: nowrap;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.scene-chip {
  min-height: 82px;
  padding: 13px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  color: var(--ink);
}

.scene-chip strong,
.scene-chip span {
  display: block;
}

.scene-chip strong {
  margin-bottom: 7px;
  font-size: 0.98rem;
}

.scene-chip span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.scene-chip.is-selected {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--chip-color) 32%, #fff 68%);
  box-shadow: 5px 5px 0 var(--chip-color);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.formula {
  min-width: min(100%, 360px);
  min-height: 44px;
  padding: 10px 14px;
  border: 2px dashed #ff9fc1;
  border-radius: 8px;
  background: #fff;
  color: #683548;
  font-weight: 800;
  text-align: center;
}

.taste-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
  padding: 10px;
  border: 1px solid #f1e8ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.taste-panel > span {
  color: #8b5265;
  font-size: 0.82rem;
  font-weight: 900;
}

.taste-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preference-chip {
  min-height: 32px;
  padding: 5px 10px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: #5f535d;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.preference-chip:hover {
  transform: translateY(-1px);
}

.preference-chip.is-selected {
  border-color: var(--ink);
  background: #fff3b7;
  box-shadow: 3px 3px 0 var(--mint);
  color: #683548;
}

.selector-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.selector-block {
  min-width: 0;
}

.block-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.block-title small {
  margin-left: auto;
  color: var(--muted);
}

.tiny-button {
  min-height: 30px;
  padding: 4px 9px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: #683548;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.mini-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 10px 0 0 var(--lemon);
}

.mixer-dot {
  background: var(--mint);
  box-shadow: 10px 0 0 var(--sky);
}

.card-grid {
  display: grid;
  gap: 12px;
}

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

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

.ingredient-card {
  display: grid;
  grid-template-rows: 58px auto 1fr;
  gap: 7px;
  min-height: 156px;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.ingredient-card:hover,
.primary-button:hover,
.ghost-button:hover,
.tiny-button:hover {
  transform: translateY(-2px);
}

.tiny-button[aria-pressed="true"] {
  background: #fff3b7;
  box-shadow: 3px 3px 0 var(--mint);
}

.ingredient-card.is-selected {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--item-color) 24%, #fff 76%);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--item-color) 70%, #fff 30%);
}

.sticker {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 56px;
  border: 2px solid #2d2730;
  border-radius: 7px 7px 13px 13px;
  background: linear-gradient(180deg, #fff 0 28%, var(--item-color) 29% 100%);
  box-shadow: 4px 4px 0 rgba(45, 39, 48, 0.12);
  color: #2d2730;
  font-weight: 900;
}

.sticker.mixer {
  width: 52px;
  height: 52px;
  border-radius: 50% 50% 8px 8px;
  background: radial-gradient(circle at 34% 28%, #fff 0 10%, transparent 11%), color-mix(in srgb, var(--item-color) 65%, #fff 35%);
}

.ingredient-name {
  font-weight: 900;
}

.ingredient-flavor {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.plus-sign {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 72px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lemon);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--pink);
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.primary-button,
.ghost-button {
  min-width: 132px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  background: var(--pink);
  box-shadow: 6px 6px 0 var(--mint);
  color: var(--ink);
}

.ghost-button {
  background: #fff;
  color: var(--ink);
}

.results-grid {
  display: block;
  overflow: hidden;
}

.recipe-card,
.empty-result,
.guide-card,
.pool-tip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.recipe-card {
  flex: 0 0 min(78vw, 360px);
  min-height: 430px;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(82, 57, 76, 0.1);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transform: scale(0.9);
  opacity: 0.68;
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
  will-change: transform, opacity;
}

.recipe-card.is-focused {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 18px 32px rgba(82, 57, 76, 0.16);
}

.recipe-card.experiment {
  border-style: dashed;
  background: #fffaf0;
}

.pool-tip {
  padding: 14px 16px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(255, 229, 122, 0.34), rgba(155, 230, 207, 0.24)),
    #fff;
}

.results-carousel {
  --carousel-card-width: min(78vw, 360px);
  display: flex;
  gap: 16px;
  margin: 0 -22px;
  padding: 22px max(22px, calc((100% - var(--carousel-card-width)) / 2)) 28px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: max(22px, calc((100% - var(--carousel-card-width)) / 2));
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.results-carousel::-webkit-scrollbar {
  display: none;
}

.results-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.pool-tip b {
  color: #7b4d00;
}

.pool-tip p {
  margin: 6px 0 10px;
  color: #5f535d;
  line-height: 1.55;
}

.tip-chip-row,
.convenience-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tip-chip,
.convenience-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.tip-chip {
  background: #fff3b7;
  color: #7b4d00;
}

.recipe-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 900;
  align-items: center;
}

.role-pill,
.strength-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1.2;
}

.role-pill {
  background: #fff3b7;
  color: #7b4d00;
}

.strength-pill {
  background: #eef8ff;
  color: #2f5c75;
  text-align: right;
}

.recipe-card h3 {
  margin: 10px 0 8px;
  font-size: 1.32rem;
}

.drink-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 128px;
  margin-bottom: 10px;
}

.cup {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  width: 86px;
  height: 112px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-top-width: 2px;
  border-radius: 12px 12px 28px 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 6px 7px 0 rgba(45, 39, 48, 0.12);
}

.cup::before {
  content: "";
  position: absolute;
  inset: 8px 10px auto auto;
  width: 12px;
  height: 56px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  z-index: 4;
}

.drink-layer {
  display: block;
  width: 100%;
  height: var(--layer-height);
  min-height: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 38%),
    var(--layer-color);
  opacity: 0.88;
}

.bubble,
.ice-cube,
.lemon-garnish {
  position: absolute;
  z-index: 5;
}

.bubble {
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
}

.b1 {
  left: 24px;
  bottom: 28px;
}

.b2 {
  left: 50px;
  bottom: 48px;
}

.b3 {
  left: 36px;
  bottom: 72px;
}

.ice-cube {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 5px;
  background: rgba(218, 246, 255, 0.52);
  transform: rotate(12deg);
}

.ice-cube.one {
  left: 22px;
  bottom: 38px;
}

.ice-cube.two {
  right: 20px;
  bottom: 56px;
  transform: rotate(-16deg);
}

.lemon-garnish {
  top: 10px;
  right: calc(50% - 55px);
  width: 30px;
  height: 30px;
  border: 3px solid #f6d447;
  border-radius: 50%;
  background: #fff27e;
  box-shadow: inset -8px 0 0 rgba(255, 196, 62, 0.58);
}

.recipe-formula {
  min-height: 46px;
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f5fff7;
  color: #34745b;
  font-size: 0.76rem;
  font-weight: 800;
}

.tag-row .template-tag {
  background: #fff3b7;
  color: #7b4d00;
}

.scene-reason {
  margin: -2px 0 10px;
  padding: 9px 10px;
  border-left: 4px solid #ff9fc1;
  border-radius: 8px;
  background: #fff8fb;
  color: #6a4d58;
  font-size: 0.84rem;
  line-height: 1.5;
}

.convenience-row {
  margin-bottom: 12px;
}

.convenience-row span {
  background: #eef8ff;
  color: #2f5c75;
}

.detail-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff3b7;
  color: #683548;
  font-weight: 900;
  cursor: pointer;
}

.recipe-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 240ms ease, opacity 180ms ease, margin-top 180ms ease;
}

.recipe-card.is-expanded .recipe-details {
  max-height: 560px;
  margin-top: 10px;
  opacity: 1;
}

dl {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid #f1e8ec;
}

dt {
  color: #a35a71;
  font-weight: 900;
}

dd {
  margin: 0;
  color: #5f535d;
  line-height: 1.5;
}

.empty-result {
  grid-column: 1 / -1;
  min-height: 148px;
  padding: 22px;
  display: grid;
  place-content: center;
  text-align: center;
}

.empty-result h3 {
  margin: 0 0 8px;
}

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

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

.guide-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  min-height: 188px;
  padding: 13px;
}

.guide-card h3 {
  margin: 0 0 6px;
}

.guide-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.guide-card small {
  color: #6b5b63;
  font-size: 0.76rem;
  line-height: 1.45;
}

.safety {
  margin: 20px auto 0;
  color: #7b6872;
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 980px) {
  .chip-row,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selector-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .plus-sign {
    margin: 0 auto;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding-top: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 18px;
    min-height: auto;
  }

  h1 {
    font-size: 2rem;
  }

  .panel,
  .mixer-stage,
  .results-section,
  .guide-section {
    padding: 16px;
  }

  .results-carousel {
    --carousel-card-width: min(74vw, 330px);
    gap: 12px;
    margin: 0 -16px;
    padding-top: 18px;
  }

  .stage-header {
    display: grid;
  }

  .results-heading {
    display: grid;
    align-items: stretch;
  }

  .formula {
    min-width: 0;
    text-align: left;
  }

  .taste-panel {
    align-items: flex-start;
  }

  .chip-row,
  .spirits-grid,
  .mixers-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .ingredient-card {
    min-height: 132px;
    grid-template-columns: 58px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
  }

  .ingredient-card .sticker {
    grid-row: 1 / 3;
  }

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

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .guide-card {
    min-height: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .results-carousel {
    scroll-behavior: auto;
  }

  .recipe-card {
    transition: none;
  }

  .recipe-details {
    transition: none;
  }
}
