:root {
  --bg: #f3fbf6;
  --bg-deep: #e3f6ea;
  --ink: #1c3328;
  --muted: #6d8b7b;
  --card: #ffffff;
  --sidebar: #e7f6ec;
  --line: rgba(28, 51, 40, .08);
  --accent: #2fa86a;
  --accent-2: #1c8f52;
  --accent-deep: #146b3d;
  --on-accent: #ffffff;
  --accent-soft: #e7fff2;
  --price: #ef5d4a;
  --header-a: #d8f8e4;
  --header-b: #8fe0b4;
  --dock: #173326;
  --dock-ink: #f3fff7;
  --shadow: 0 12px 28px rgba(36, 90, 58, .14);
  --stage: #d5f0e1;
  --cat: #1b1b1b;
  --eye: #f2c14e;
  --blush: #ff9eb5;
  --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cg fill='%23000' fill-opacity='.14'%3E%3Ccircle cx='40' cy='50' r='16'/%3E%3Ccircle cx='18' cy='30' r='8'/%3E%3Ccircle cx='34' cy='18' r='8'/%3E%3Ccircle cx='54' cy='18' r='8'/%3E%3Ccircle cx='66' cy='32' r='7'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--stage);
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
button:active { transform: translateY(1px); }
img { display: block; max-width: 100%; }

.stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .55), transparent 28%),
    radial-gradient(circle at 88% 80%, rgba(255, 255, 255, .28), transparent 26%),
    var(--stage);
}
.stage-note { width: 280px; color: var(--ink); }
.stage-note h1 {
  margin: 8px 0 6px;
  font-family: "YouYuan", "Yuanti SC", "PingFang SC", sans-serif;
  font-size: 36px;
  font-weight: 400;
}
.stage-note p { margin: 0 0 10px; line-height: 1.65; color: var(--ink); opacity: .86; }
.stage-note .fine { font-size: 13px; opacity: .7; }
.stage-cat { width: 120px; }
.cat-sit { animation: bob 2.8s ease-in-out infinite; transform-origin: 50% 80%; }
.cast-sit, .cast-hero, .float-cast { animation: bob 2.8s ease-in-out infinite; transform-origin: 50% 80%; }
.stage-link {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}

.phone {
  position: relative;
  width: 390px;
  height: min(844px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(255, 170, 190, .35) 1.1px, transparent 1.3px);
  background-size: 16px 16px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 10px #1b1b1b;
}
.top {
  flex: none;
  padding: 14px 12px 12px;
  background: linear-gradient(155deg, var(--header-a), var(--header-b));
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-photo {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: cover;
  border-radius: 26px;
  border: 3px solid #fff;
  box-shadow: 0 6px 0 rgba(0,0,0,.08);
  transform: rotate(-8deg);
  background: #fff;
}
.float-sticker {
  position: absolute;
  right: 10px;
  bottom: 126px;
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 26px;
  border: 3px solid #fff;
  box-shadow: 0 8px 0 rgba(0,0,0,.08);
  transform: rotate(8deg);
  pointer-events: none;
  z-index: 6;
}
.cat-foot { margin-top: auto; padding: 8px 8px 12px; }
.cat-foot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.06);
}
.empty-sticker, .dialog-sticker, .hero-sticker, .me-sticker {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 28px;
  border: 3px solid #fff;
  box-shadow: 0 6px 0 rgba(0,0,0,.06);
}
.empty-sticker, .dialog-sticker, .me-sticker { display: block; margin: 0 auto 8px; }
.hero-sticker { width: 72px; height: 72px; flex: none; transform: rotate(-6deg); }
.brand-text h1, .dish-name, .hero-card h2, .me-card h2 {
  font-family: "YouYuan", "Yuanti SC", "PingFang SC", sans-serif;
}
.brand .cast-sit, .brand .cast {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
}
.cast {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.cast-peek {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
}
.cast-hero, .cast-empty, .cast-buddy, .cast-sit {
  width: 120px;
  margin: 0 auto;
  object-fit: contain;
}
.cast-face {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.sticker-row {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 0 4px 8px;
  scrollbar-width: none;
}
.sticker-row::-webkit-scrollbar { display: none; }
.sticker-row .cast {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: none;
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 4px;
}
.cast-banner {
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
  margin-bottom: 10px;
}
.float-cast {
  position: absolute;
  right: 8px;
  bottom: 118px;
  width: 78px;
  pointer-events: none;
  z-index: 5;
  opacity: .95;
  animation: bob 2.8s ease-in-out infinite;
}
.float-cast img { width: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.dialog .cast-sit, .dialog .cast-hero, .dialog .cast-empty {
  width: 140px;
}
.sheet .cast-face { margin: 0 auto 6px; }
.me-cast-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}
.me-cast-grid .cast {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg-deep);
  border-radius: 16px;
  padding: 6px;
}
.stage-cast-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.stage-cast-row .cast { width: 72px; height: 88px; object-fit: contain; }
.stage-cast-row .cast:first-child { width: 96px; height: 110px; }
.brand-text { flex: 1; min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-family: "YouYuan", "Yuanti SC", "PingFang SC", sans-serif;
  font-weight: 700;
}
.brand-text p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  opacity: .78;
}
.chip {
  flex: none;
  max-width: 128px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}
.balance-pill {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}
.search-row { display: flex; gap: 8px; margin-top: 8px; }
.search {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-2);
  background: var(--card);
  color: var(--ink);
  padding: 0 12px 0 34px;
  font-size: 16px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px 50%;
  background-size: 16px;
}
.search::placeholder { color: var(--muted); }
.mini-btn {
  flex: none;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.phone:not(.page-home) .search-row { display: none; }

html[data-tone="quiet"] .phone { background-image: none; }
html[data-tone="quiet"] .brand-photo,
html[data-tone="quiet"] .cat-foot img,
html[data-tone="quiet"] .empty-sticker,
html[data-tone="quiet"] .dialog-sticker,
html[data-tone="quiet"] .hero-sticker,
html[data-tone="quiet"] .me-sticker {
  transform: none;
  border-width: 1px;
  border-color: var(--line);
  box-shadow: none;
}
html[data-tone="quiet"] .dish {
  box-shadow: none;
  border: 1px solid var(--line);
}

.panels { flex: 1; min-height: 0; display: flex; background: var(--card); }
.cats, .list { scrollbar-width: none; }
.cats::-webkit-scrollbar, .list::-webkit-scrollbar { width: 0; height: 0; }
.cats {
  width: 86px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  overflow: auto;
}
.phone:not(.page-home) .cats { display: none; }
.cat-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  margin: 6px 8px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.25;
  border-radius: 22px;
}
.cat-ico { font-size: 16px; }
.cat-btn.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
}
.cat-foot { margin-top: auto; padding: 6px 4px 10px; }
.cat-foot .cast { width: 100%; }

.list { flex: 1; min-width: 0; overflow: auto; background: var(--bg); }
.dish {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 10px;
  padding: 10px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 6px 0 rgba(0,0,0,.04);
}
.thumb {
  position: relative;
  width: 88px;
  height: 88px;
  flex: none;
  border: 0;
  padding: 0;
  background: var(--bg-deep);
  border-radius: 24px;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.love {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--price);
  font-size: 12px;
  display: grid;
  place-items: center;
}
.dish-main { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; text-align: left; padding: 0; }
.dish-name {
  font-size: 16px;
  font-weight: 800;
  font-family: "YouYuan", "Yuanti SC", "PingFang SC", sans-serif;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dish-price { margin-top: 4px; color: var(--price); font-weight: 800; font-size: 15px; }
.dish-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.add {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.add.pop { animation: pop .28s ease; }
.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--price);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.badge[hidden] { display: none; }
.end, .hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 12px 18px;
}
.empty { text-align: center; padding: 28px 16px 40px; color: var(--muted); }
.empty .cat { width: 140px; margin: 0 auto 8px; }

.dock-wrap { flex: none; padding: 8px 10px 8px; background: linear-gradient(transparent, var(--bg) 30%); }
.dock {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.ghost, .invite, .order-btn { border: 0; height: 42px; }
.ghost {
  width: 54px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1.1;
  gap: 1px;
}
.ghost b { font-size: 16px; font-weight: 500; }
.invite {
  flex: 1;
  border-radius: 999px;
  background: var(--dock);
  color: var(--dock-ink);
  font-size: 12px;
  font-weight: 700;
}
.order-btn {
  flex: 1.15;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.order-btn small { font-weight: 700; margin-left: 4px; }

.tabs {
  flex: none;
  height: calc(54px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent-2); font-weight: 800; }

.page-pad { padding: 14px 14px 24px; }
.hero-card, .me-card, .order-card, .square-card {
  background: var(--bg-deep);
  border-radius: 28px;
  padding: 14px;
}
.hero-card { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.hero-card .cat, .me-card .cat { width: 92px; flex: none; }
.hero-card h2, .me-card h2, .dialog h3, .sheet h3 { margin: 0 0 4px; font-size: 18px; }
.hero-card p, .me-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.square-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--bg);
}
.square-card img { width: 88px; height: 88px; object-fit: cover; border-radius: 24px; }
.square-card strong { display: block; }
.square-card span { color: var(--muted); font-size: 12px; }
.me-card { text-align: center; margin-bottom: 12px; }
.me-card .cat { margin: 0 auto; }
.stat-row { display: flex; gap: 8px; margin: 12px 0; }
.stat {
  flex: 1;
  background: var(--bg-deep);
  border-radius: 22px;
  padding: 10px 6px;
  text-align: center;
}
.stat b { display: block; font-size: 13px; line-height: 1.3; word-break: break-all; }
.stat span { color: var(--muted); font-size: 12px; }
.order-card { margin-bottom: 8px; }
.order-card b { font-size: 13px; }
.order-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.linkish {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(12, 16, 14, .46);
  display: flex;
  align-items: flex-end;
}
.overlay[hidden] { display: none; }
.overlay.center { align-items: center; padding: 22px; }
.sheet, .dialog {
  width: 100%;
  background: var(--card);
  color: var(--ink);
  border-radius: 26px 26px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 86%;
  overflow: auto;
  animation: rise .28s ease;
}
.dialog { border-radius: 26px; padding: 18px 16px 16px; text-align: center; animation: pop .28s ease; }
.grab { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 6px auto 10px; }
.sheet-dish { display: flex; gap: 12px; text-align: left; }
.sheet-dish img, .dialog img.food {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 28px;
  flex: none;
}
.dialog img.food { width: 160px; height: 160px; margin: 8px auto; border-radius: 36px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 11px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
}
.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.stepper button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 20px;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.stepper b { min-width: 24px; font-size: 18px; }
.line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.note {
  width: 100%;
  margin: 10px 0;
  height: 40px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0 12px;
  font-size: 16px;
}
.full {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.full.ghosted {
  margin-top: 8px;
  background: var(--bg-deep);
  color: var(--ink);
  box-shadow: none;
}
.dialog .cat { width: 120px; margin: 0 auto 4px; }
.copy-box {
  width: 100%;
  height: 40px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0 10px;
  margin: 8px 0 12px;
}

.boot {
  margin: auto;
  text-align: center;
  color: var(--muted);
}
.boot-face {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-family: "YouYuan", "Yuanti SC", sans-serif;
  font-size: 28px;
  animation: bob 1.6s ease-in-out infinite;
}
.boot-face::before { content: "喵"; }

.toast {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--dock);
  color: var(--dock-ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  animation: pop .25s ease;
}
.float-one {
  position: absolute;
  z-index: 35;
  color: var(--price);
  font-weight: 800;
  pointer-events: none;
  animation: floatup .7s ease forwards;
}
.burst { position: absolute; inset: 0; pointer-events: none; z-index: 34; overflow: hidden; }
.burst i {
  position: absolute;
  top: -10px;
  font-style: normal;
  animation: fall 1.3s ease-in forwards;
}

.cat-sit { animation: bob 2.8s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes pop { from { transform: scale(.86); } to { transform: scale(1); } }
@keyframes rise { from { transform: translateY(16px); opacity: .6; } }
@keyframes floatup { to { transform: translateY(-26px); opacity: 0; } }
@keyframes fall { to { transform: translateY(780px) rotate(40deg); opacity: .2; } }

.checkin { text-align: center; padding-top: 28px; }
.checkin-count {
  font-size: 32px;
  line-height: 1.15;
  font-family: "YouYuan", "Yuanti SC", "PingFang SC", sans-serif;
  margin: 6px 0;
  letter-spacing: -0.4px;
}
.month-title { margin: 14px 0 8px; font-weight: 800; }
.month-head, .month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.month-head span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.month { margin-bottom: 16px; }
.month b {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-deep);
}
.month b.empty { visibility: hidden; }
.month b.on { background: var(--accent); color: var(--on-accent); }
.month b.today { box-shadow: inset 0 0 0 1.5px var(--accent-2); }
.checkin.page-pad {
  padding-left: 12px;
  padding-right: 12px;
  overflow-x: hidden;
}
.checkin-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.checkin-btn:disabled {
  background: var(--bg-deep);
  color: var(--muted);
  box-shadow: none;
}

@media (max-width: 760px) {
  .stage { padding: 0; display: block; background: var(--bg); }
  .stage-note { display: none; }
  .phone {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}
html.embed .stage { padding: 0; display: block; background: var(--bg); min-height: 100%; }
html.embed .stage-note { display: none; }
html.embed .phone {
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
