/* ============================================================
   吃啥鸭 —— 样式（可爱版）
   奶油粉 + 蜜桃珊瑚，大圆角贴纸感，移动端优先
   ============================================================ */

:root {
  --bg-1: oklch(97.5% 0.018 75);
  --bg-2: oklch(94.5% 0.035 22);
  --surface: oklch(99.8% 0.004 80);
  --ink: oklch(32% 0.032 42);
  --ink-soft: oklch(55% 0.03 42);
  --accent: oklch(70% 0.155 25);
  --accent-deep: oklch(56% 0.17 25);
  --pink: oklch(80% 0.095 3);
  --accent-soft: oklch(92.5% 0.045 35);
  --pink-soft: oklch(94.5% 0.028 8);
  --lilac-soft: oklch(94.5% 0.025 320);
  --mint-soft: oklch(95% 0.03 160);
  --line: oklch(93% 0.015 65);
  --radius-lg: 26px;
  --radius-md: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 8px 26px oklch(45% 0.07 25 / 0.11);
  --shadow-cta: 0 10px 26px oklch(56% 0.17 25 / 0.35);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2) 90%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: var(--radius-pill);
}

/* ---------- 背景装饰 ---------- */
.bg-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.6;
}
.blob-1 { top: -90px; right: -80px; background: var(--accent-soft); }
.blob-2 { bottom: -110px; left: -100px; background: var(--pink-soft); }
.bg-deco::after {
  content: "";
  position: absolute;
  top: 42%;
  left: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.45;
  background: var(--lilac-soft);
}

.floaties {
  position: absolute;
  inset: 0;
}
.floaties span {
  position: absolute;
  font-size: 16px;
  opacity: 0.5;
  animation: floaty 6s ease-in-out infinite;
}
.floaties span:nth-child(1) { top: 14%; left: 10%; animation-delay: 0s; }
.floaties span:nth-child(2) { top: 30%; right: 8%; animation-delay: 1.4s; font-size: 20px; }
.floaties span:nth-child(3) { top: 62%; left: 6%; animation-delay: 2.6s; font-size: 13px; }
.floaties span:nth-child(4) { top: 80%; right: 12%; animation-delay: 0.8s; }
.floaties span:nth-child(5) { top: 8%; left: 46%; animation-delay: 3.4s; font-size: 12px; }

/* ---------- 布局 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(24px, 7vw, 48px) 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.view { display: none; }
.view.active {
  display: block;
  animation: fade-up 0.35s ease both;
}

/* ---------- 首页 ---------- */
.hero { text-align: center; }
.hero h1 {
  font-size: clamp(30px, 8.5vw, 38px);
  font-weight: 900;
  letter-spacing: 1px;
}
.hero h1::before { content: "✨ "; font-size: 0.6em; }
.hero h1::after { content: " ✨"; font-size: 0.6em; }
.duck {
  display: inline-block;
  animation: wiggle 2.8s ease-in-out infinite;
}
.sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 15px;
}

.cta {
  display: block;
  width: 100%;
  margin-top: 34px;
  padding: 17px 24px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(130deg, var(--accent), var(--pink));
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: var(--shadow-cta);
  transition: transform 0.18s cubic-bezier(0.25, 1, 0.5, 1);
  animation: breathe 3s ease-in-out infinite;
}
.cta:hover { transform: translateY(-2px); }
.cta:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 4px 10px oklch(56% 0.17 25 / 0.3);
}

.cta.soft {
  margin-top: 16px;
  background: var(--surface);
  color: var(--accent-deep);
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px oklch(45% 0.07 25 / 0.08);
  animation: none;
}
.cta.soft:active { box-shadow: none; }

.hint {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 分类筛选（想吃哪一类） ---------- */
.filters-wrap { margin-top: 30px; }
.filters-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 3px 10px oklch(45% 0.07 25 / 0.06);
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.15s;
}
.chip:hover { transform: translateY(-2px) rotate(-1deg); }
.chip:active { transform: scale(0.95); }
.chip.active {
  background: linear-gradient(130deg, var(--accent), var(--pink));
  border-color: transparent;
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-cta);
}

/* ---------- 历史 ---------- */
.history-wrap { margin-top: 28px; }
.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.history-chip {
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-soft);
}
.no-history { text-align: left; }
.count-hint { text-align: left; margin-top: 8px; }

/* ---------- 三选一 ---------- */
.pick-head { text-align: center; }
.pick-head h2 {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 1px;
}

.cards {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-wrap {
  position: relative;
  animation: pop-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 58px 18px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}
.card:hover { transform: translateY(-3px) rotate(-0.5deg); }
.card:active { transform: scale(0.98); }
.card-emoji {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-soft), var(--pink-soft));
  font-size: 30px;
  transition: transform 0.2s;
  box-shadow: inset 0 0 0 2px oklch(100% 0 0 / 0.5);
}
.card-wrap:nth-child(2) .card-emoji {
  background: linear-gradient(135deg, var(--pink-soft), var(--lilac-soft));
  transform: rotate(-4deg);
}
.card-wrap:nth-child(3) .card-emoji {
  background: linear-gradient(135deg, var(--lilac-soft), var(--mint-soft));
  transform: rotate(3deg);
}
.card:hover .card-emoji { transform: rotate(0deg) scale(1.1); }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-name { font-size: 20px; font-weight: 800; }
.card-cat {
  align-self: flex-start;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--pink-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}
.card-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.card-swap {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--ink-soft);
  font-size: 14px;
  transition: color 0.15s, transform 0.15s, background 0.15s;
}
.card-swap:hover { color: var(--accent-deep); background: var(--accent-soft); transform: rotate(90deg); }

.empty-note {
  text-align: center;
  color: var(--ink-soft);
  padding: 44px 0;
  line-height: 1.9;
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.row-actions.col { flex-direction: column; gap: 12px; }
.btn.ghost {
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 3px 10px oklch(45% 0.07 25 / 0.06);
  transition: transform 0.12s, border-color 0.12s;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn.ghost:active { transform: translateY(2px); }

/* ---------- 结果 ---------- */
#view-result { text-align: center; }
.result-emoji {
  position: relative;
  margin-top: 18px;
  font-size: 96px;
  animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.result-emoji::after {
  content: "✨";
  position: absolute;
  top: -12px;
  right: -18px;
  font-size: 26px;
  animation: twinkle 1.8s ease-in-out infinite;
}
.result-label {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 6px;
}
.result-name {
  margin-top: 4px;
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  letter-spacing: 1px;
  animation: fade-up 0.5s 0.15s ease both;
}
.result-cat {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(130deg, var(--accent-soft), var(--pink-soft));
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 800;
  animation: fade-up 0.5s 0.25s ease both;
}
.result-desc {
  margin: 14px auto 0;
  max-width: 330px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
  animation: fade-up 0.5s 0.3s ease both;
}
.sweet-line {
  margin: 14px auto 0;
  max-width: 330px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
  animation: fade-up 0.5s 0.4s ease both;
}
#view-result .row-actions { margin-top: 30px; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: auto;
  padding-top: 42px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ---------- 彩带 ---------- */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  animation: fall linear forwards;
}

/* ---------- 动画 ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes bounce-in {
  from { opacity: 0; transform: scale(0.2); }
  60% { opacity: 1; transform: scale(1.15); }
  to { transform: scale(1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 10px 26px oklch(56% 0.17 25 / 0.35); }
  50% { box-shadow: 0 12px 32px oklch(56% 0.17 25 / 0.48); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(680deg); opacity: 0; }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
}

/* ---------- 首页：想怎么选 ---------- */
.mode-ask {
  margin-top: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 2px;
}
#view-home .cta { margin-top: 16px; }

/* ---------- 健康观察员 ---------- */
.health-note {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--mint-soft);
  border: 1.5px solid oklch(88% 0.04 160);
  color: oklch(38% 0.06 160);
  font-size: 13px;
  line-height: 1.7;
  animation: fade-up 0.4s ease both;
}

.health-tip {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--mint-soft), var(--bg-1));
  border: 1.5px solid oklch(88% 0.04 160);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: oklch(38% 0.06 160);
  font-size: 14px;
  line-height: 1.7;
  animation: fade-up 0.4s ease both;
}
.tip-action {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(130deg, var(--accent), var(--pink));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 16px oklch(56% 0.17 25 / 0.3);
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}
.tip-action:active { transform: translateY(2px); }

/* ---------- 第 2 步：想吃哪一类 ---------- */
#view-category .filters {
  margin-top: 24px;
  justify-content: center;
}

/* ---------- 完工页（已收到） ---------- */
#view-done { text-align: center; }
.done-emoji {
  margin-top: 40px;
  font-size: 92px;
  line-height: 1;
  animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.done-emoji span {
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out 0.6s infinite;
}
.done-label {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 5px;
}
.done-title {
  margin-top: 6px;
  font-size: clamp(28px, 8.5vw, 38px);
  font-weight: 900;
  letter-spacing: 1px;
  animation: fade-up 0.5s 0.1s ease both;
}
.done-line {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
  animation: fade-up 0.5s 0.2s ease both;
}
#view-done .row-actions { margin-top: 30px; }

/* ---------- 天气提示 ---------- */
.weather-note {
  margin-top: 10px;
  padding: 8px 16px;
  display: inline-block;
  border-radius: var(--radius-pill);
  background: var(--lilac-soft);
  border: 1.5px solid oklch(90% 0.03 320);
  color: oklch(45% 0.07 320);
  font-size: 13px;
  animation: fade-up 0.4s ease both;
}

/* ---------- 心情模式 ---------- */
.mood-wrap { margin-top: 28px; }
.mood-wrap .chip {
  padding: 9px 15px;
  font-size: 13px;
}

/* ---------- 完工页：接单状态 ---------- */
.status-box {
  margin-top: 24px;
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line);
  background: var(--surface);
  font-size: 15px;
  animation: fade-up 0.4s 0.3s ease both;
}
.status-box.placed {
  border: 1.5px solid oklch(88% 0.04 160);
  background: var(--mint-soft);
  color: oklch(38% 0.06 160);
  font-weight: 700;
  animation: pop-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- 完工页：吃完打分 ---------- */
.rate-box { margin-top: 26px; }
.rate-label {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 12px;
}
.rate-btns {
  display: flex;
  gap: 10px;
}
.rate-btn {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 3px 10px oklch(45% 0.07 25 / 0.06);
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.15s;
}
.rate-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.rate-btn:active { transform: scale(0.96); }
.rate-btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}
.rate-feedback {
  margin-top: 10px;
  text-align: center;
  color: var(--accent-deep);
  font-size: 13px;
  line-height: 1.7;
  min-height: 22px;
  animation: fade-up 0.4s ease both;
}

/* ---------- 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}