:root {
  --bg: #fdfaf6;
  --card: #ffffff;
  --ink: #4f4540;
  --ink-mid: #8a7d75;
  --ink-soft: #b5a9a0;
  --accent: #e8a08a;
  --accent-soft: #fdf0e9;
  --accent-deep: #d98a71;
  --cream: #f7ecdf;
  --sage: #cfdcc9;
  --line: #f2eae2;
  --shadow: 0 3px 18px rgba(180, 150, 130, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景柔光 */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.38;
  pointer-events: none;
  z-index: 0;
}
.blob-a {
  width: 260px; height: 260px;
  background: var(--cream);
  top: -80px; right: -90px;
}
.blob-b {
  width: 280px; height: 280px;
  background: var(--sage);
  bottom: 8%; left: -110px;
  opacity: 0.26;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px calc(48px + env(safe-area-inset-bottom));
}

/* ---------- 标题 ---------- */
.hero {
  text-align: center;
  padding: calc(52px + env(safe-area-inset-top)) 0 34px;
}
.cup {
  font-size: 60px;
  line-height: 1;
  display: inline-block;
  animation: sway 3.8s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-7px); }
}
.hero h1 {
  margin: 22px 0 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: 26px;
  padding: 24px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.card h2 i {
  font-style: normal;
  font-size: 19px;
}
.tip {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-mid);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 3px;
}

/* ---------- 选项 ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}
.chip {
  border: 1.5px solid var(--line);
  background: #fffdfb;
  color: var(--ink-mid);
  border-radius: 999px;
  padding: 11px 19px;
  font-size: 15.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.34,1.4,.64,1);
}
.chip:active { transform: scale(0.94); }
.chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- 输入 ---------- */
.field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fffdfb;
  margin-top: 15px;
  resize: none;
  line-height: 1.6;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.field::placeholder { color: var(--ink-soft); }

/* ---------- 小票 ---------- */
.receipt {
  background: #fff;
  border: 2px dashed var(--cream);
  border-radius: 24px;
  padding: 24px 24px 26px;
  margin: 30px 0 20px;
}
.receipt-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.receipt-top .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}
.receipt-title {
  font-size: 13px;
  color: var(--ink-mid);
  letter-spacing: 0.22em;
}
.receipt-body {
  font-size: 16.5px;
  line-height: 2.05;
  color: var(--ink);
  text-align: center;
  white-space: pre-line;
  font-weight: 500;
}
.receipt-body .dim {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 400;
}

/* ---------- 提交 ---------- */
.submit {
  width: 100%;
  border: none;
  border-radius: 22px;
  background: linear-gradient(135deg, #eeab94 0%, #e2917a 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  padding: 20px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(217, 138, 113, 0.26);
  transition: transform 0.18s cubic-bezier(.34,1.4,.64,1);
}
.submit span { letter-spacing: 0.06em; }
.submit:active { transform: scale(0.975); }
.submit:disabled { opacity: 0.6; }

/* ---------- 历史 ---------- */
.history { margin-top: 32px; }
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  background: #fdfaf7;
  border-radius: 16px;
  padding: 14px 10px 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s;
}
.history-item:active { background: var(--accent-soft); }
.hi-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.hi-del {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 21px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.hi-del:active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  transform: scale(0.88);
}
.hi-main {
  font-size: 14.5px;
  color: var(--ink-mid);
  line-height: 1.65;
}
.hi-time {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 5px;
}
.empty {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
}

.foot {
  text-align: center;
  font-size: 17px;
  margin-top: 32px;
  opacity: 0.4;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(54px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px) scale(0.94);
  background: #fff;
  border: 2px solid var(--accent-soft);
  color: var(--accent-deep);
  padding: 15px 28px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(.34,1.4,.64,1);
  z-index: 99;
  max-width: 82vw;
  text-align: center;
  box-shadow: 0 6px 24px rgba(200, 160, 140, 0.2);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
