:root {
  --paper: #f3ece0;
  --paper-2: #ebe1d0;
  --ink: #3b2418;
  --ink-soft: #6b4f3f;
  --accent: #a8643a;
  --line: rgba(59, 36, 24, .18);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--paper);
  /* 纸感：很淡的噪点 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .14 0 0 0 0 .09 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  padding-bottom: 84px;
}
h1, h2, h3 { font-family: "Noto Serif SC", serif; margin: 0; }
.script { font-family: "Caveat Brush", cursive; font-weight: 400; }
.muted { color: var(--ink-soft); font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(243, 236, 224, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: "Caveat Brush", cursive; font-size: 26px; color: var(--ink); text-decoration: none; }
.brand span { font-family: "Noto Serif SC", serif; font-size: 15px; margin-left: 2px; }
.top-btn { color: var(--paper); background: var(--ink); padding: 6px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; }

/* 首页 */
.hero { position: relative; text-align: center; padding: 48px 16px 40px; overflow: hidden; }
.kicker { letter-spacing: .2em; font-size: 13px; color: var(--ink-soft); margin: 0; }
.hero h1.script { font-size: clamp(96px, 30vw, 180px); line-height: .9; margin: 6px 0 4px; transform: rotate(-4deg); }
.lead { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: 24px; margin: 8px 0 0; }
.sub { margin: 4px 0 22px; color: var(--ink-soft); }
.hero-cup { width: 96px; height: 120px; color: var(--ink); display: block; margin: 18px auto 8px; animation: bob 3.2s ease-in-out infinite; }
.deco { position: absolute; color: var(--accent); }
.deco.s1 { width: 34px; height: 34px; top: 34px; left: 9%; animation: twinkle 2.6s ease-in-out infinite; }
.deco.s2 { width: 22px; height: 22px; top: 150px; right: 10%; animation: twinkle 3.1s ease-in-out .6s infinite; }
.deco.s3 { width: 36px; height: 36px; bottom: 70px; left: 12%; color: var(--ink-soft); transform: rotate(-20deg); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .55; } }

.btn {
  display: inline-block; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 700; padding: 10px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn.big { font-size: 18px; padding: 13px 34px; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:active { transform: translateY(1px); }

.info { display: grid; gap: 14px; padding: 0 16px 32px; max-width: 720px; margin: 0 auto; }
@media (min-width: 640px) { .info { grid-template-columns: 1fr 1fr; } }
.info-card { border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; background: var(--paper-2); }
.info-card h2 { font-size: 18px; margin-bottom: 6px; }
.info-card ol { margin: 0; padding-left: 20px; }
.info-card p { margin: 0; }

/* 菜单 */
.order, .checkout, .done { padding: 28px 16px; max-width: 720px; margin: 0 auto; }
.sec-title { text-align: center; font-size: 24px; margin-bottom: 6px; }
.sec-title .script.small { display: block; font-size: 44px; line-height: 1; transform: rotate(-3deg); }
.menu { list-style: none; padding: 0; margin: 18px 0 0; }
.item { border-bottom: 1.5px dashed var(--line); padding: 14px 0; }
.item-head { display: flex; align-items: baseline; gap: 8px; }
.item-name { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: 19px; white-space: nowrap; }
.item-en { color: var(--ink-soft); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); min-width: 12px; }
.item-price { font-weight: 700; white-space: nowrap; }
.item-note { font-size: 13px; color: var(--accent); }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.qty button {
  min-width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--ink);
  background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; padding: 0 6px;
}
.qty button.on { background: var(--ink); color: var(--paper); }
.qty button.pm { border-style: dashed; }
.qty .count { min-width: 44px; text-align: center; font-weight: 700; }

.beans { margin-top: 22px; border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 18px; }
.beans h3 { font-size: 17px; margin-bottom: 8px; }
.bean-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.bean-opts label { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.bean-opts input { accent-color: var(--ink); }

/* 底部购物车 */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
}
.bar #bar-total { flex: 1; font-weight: 700; }
.bar .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* 结账 */
.cart-lines { list-style: none; padding: 0; margin: 12px 0; }
.cart-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.subtotal { text-align: right; font-size: 18px; margin: 8px 0 18px; }
form label { display: block; font-weight: 700; margin-bottom: 14px; }
form .opt { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
form input, form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; color: var(--ink);
  background: #fbf7f0; border: 2px solid var(--ink); border-radius: 12px;
}
form input:focus, form textarea:focus { outline: 3px solid rgba(168, 100, 58, .35); }
.err { color: #a12a1a; min-height: 1.2em; margin: 0 0 10px; }

/* 完成 */
.done { text-align: center; }
.done-cup { width: 64px; height: 80px; color: var(--ink); }
.summary { text-align: left; border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 18px; background: var(--paper-2); margin: 12px 0 18px; }
.summary dl { margin: 0; }
.summary dt { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.summary dd { margin: 0; white-space: pre-wrap; }
.pay { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 16px; }
.pay h3 { font-size: 18px; }
.pay p { margin: 4px 0; }
.pay-soon { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: 20px; color: var(--accent); }
.preview-note { font-size: 13px; color: var(--ink-soft); margin: 16px 0; }

.foot { text-align: center; padding: 24px 16px 12px; color: var(--ink-soft); }
.foot .script { font-size: 32px; margin: 0; color: var(--ink); }
.foot p { margin: 0; }
