:root {
  --green: #4caf50;
  --green-d: #388e3c;
  --wood: #c79a6b;
  --egg: #ffd23f;
  --bg: #eaf7e6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: #333;
  max-width: 480px;
  margin: 0 auto;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶栏 */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--green); color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.topbar .logo { font-weight: 700; font-size: 17px; }
.topbar .wallet { background: rgba(255,255,255,.2); padding: 4px 12px; border-radius: 20px; font-size: 14px; }
.topbar .wallet span { font-weight: 700; }

/* 农场 */
.farm {
  position: relative; height: 280px; overflow: hidden;
  background: linear-gradient(#bfe9ff 0%, #d8f3ff 55%, #eaf7e6 100%);
}
.sun {
  position: absolute; top: 18px; right: 22px; width: 52px; height: 52px;
  background: radial-gradient(circle, #fff3b0, #ffd23f); border-radius: 50%;
  box-shadow: 0 0 24px #ffe066;
}
.cloud {
  position: absolute; background: #fff; border-radius: 50%;
  width: 60px; height: 24px; opacity: .9;
  box-shadow: 18px 6px 0 -2px #fff, -18px 6px 0 -2px #fff;
}
.cloud.c1 { top: 40px; left: 18px; animation: drift 18s linear infinite; }
.cloud.c2 { top: 80px; left: 120px; transform: scale(.8); animation: drift 26s linear infinite; }
@keyframes drift { from { left: -80px; } to { left: 110%; } }

.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(#a8d58a, #8bc46a);
  border-top: 6px solid #6fae4f;
}
.chicken {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: 120px; height: 120px; transition: transform .2s;
}
.chicken svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.chicken.shake { animation: shake .5s; }
@keyframes shake {
  0%,100% { transform: translateX(-50%) rotate(0); }
  25% { transform: translateX(-54%) rotate(-6deg); }
  75% { transform: translateX(-46%) rotate(6deg); }
}
.egg-pop, .feed-pop {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  font-size: 30px; opacity: 0; pointer-events: none;
}
.egg-pop.show { animation: eggFall 1s ease forwards; }
.feed-pop.show { animation: feedDrop .6s ease forwards; }
@keyframes eggFall {
  0% { opacity: 0; bottom: 120px; }
  30% { opacity: 1; bottom: 90px; }
  100% { opacity: 0; bottom: 30px; }
}
@keyframes feedDrop {
  0% { opacity: 0; bottom: 200px; }
  60% { opacity: 1; bottom: 120px; }
  100% { opacity: 0; bottom: 110px; }
}

/* 面板 */
.panel { padding: 18px 16px 8px; text-align: center; }
.stat-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.stat {
  flex: 1; background: #fff; border-radius: 14px; padding: 12px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat .num { font-size: 24px; font-weight: 800; color: var(--green-d); }
.stat .lbl { font-size: 12px; color: #888; margin-top: 2px; }

.streak { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.streak .dot {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 2px solid var(--green); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--green); font-weight: 700;
}
.streak .dot.on { background: var(--green); color: #fff; }
.streak .dot.today { box-shadow: 0 0 0 3px #ffe9a8; }

.feed-btn {
  width: 100%; padding: 15px; font-size: 17px; font-weight: 700; color: #fff;
  background: linear-gradient(var(--green), var(--green-d)); border: none; border-radius: 30px;
  box-shadow: 0 6px 14px rgba(76,175,80,.4); cursor: pointer; transition: transform .1s;
}
.feed-btn:active { transform: scale(.97); }
.feed-btn:disabled { background: #bdbdbd; box-shadow: none; }
.tip { font-size: 12px; color: #888; margin: 10px 0 0; }

/* 鸡蛋盒卡片 */
.box-card {
  margin: 14px 16px; background: #fff; border-radius: 16px; padding: 16px;
  text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border: 2px dashed var(--egg);
}
.box-card h3 { margin: 0 0 10px; color: var(--green-d); }
.qrcode { display: flex; justify-content: center; margin: 8px 0; }
.qrcode img, .qrcode canvas { width: 140px !important; height: 140px !important; }
.box-card .code { font-size: 18px; font-weight: 800; letter-spacing: 2px; color: #ff8f00; }
.box-tip { font-size: 12px; color: #999; margin: 6px 0 0; }

/* 门店 */
.stores { padding: 8px 16px 20px; }
.stores h3 { font-size: 16px; margin: 8px 0 12px; }
.store-list .loading { color: #999; font-size: 13px; }
.store-item {
  background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.store-item .name { font-weight: 700; font-size: 15px; }
.store-item .meta { font-size: 13px; color: #777; margin-top: 4px; line-height: 1.5; }
.store-item .nav {
  display: inline-block; margin-top: 8px; color: #fff; background: var(--green);
  padding: 5px 14px; border-radius: 16px; font-size: 12px; text-decoration: none;
}

.foot { text-align: center; font-size: 12px; color: #aaa; padding: 16px 0 24px; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 99;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }
