* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: #FBF3E4;
  color: #3A2A18;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  overscroll-behavior-y: none;
}
body {
  background-image:
    radial-gradient(circle at 12% 0%, rgba(255, 196, 120, 0.45), transparent 46%),
    radial-gradient(circle at 92% 8%, rgba(160, 214, 130, 0.40), transparent 42%),
    linear-gradient(180deg, #FFF6E6 0%, #FBF3E4 40%, #F4EAD6 100%);
  background-attachment: fixed;
}
.farm-app {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  min-height: 100vh;
}

/* HUD */
.hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 138, 61, 0.22);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(180, 120, 60, 0.14);
  backdrop-filter: blur(8px);
}
.hud-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FFB066, #FF8A3D);
  color: #fff; font-size: 22px;
  box-shadow: 0 4px 10px rgba(255, 138, 61, 0.35);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hud-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nick { font-size: 15px; font-weight: 700; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv { font-size: 11px; color: #A08A6E; font-weight: 600; }
.hud-coins {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px;
  background: linear-gradient(160deg, #FFE9C4, #FFD79A);
  border: 1px solid rgba(214, 150, 60, 0.35);
  color: #8A5A12; font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hud-coins .mp-icon { font-size: 18px; color: #E8A33C; }

/* Tabs */
.tabs {
  display: flex; gap: 8px; margin: 12px 0 14px;
  padding: 5px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 138, 61, 0.16);
}
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 4px; border: 0; border-radius: 12px;
  background: transparent; color: #9A8368;
  font-size: 13px; font-weight: 700; font-family: inherit;
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.tab .mp-icon { font-size: 17px; }
.tab.active {
  background: linear-gradient(160deg, #FFA45C, #FF8A3D);
  color: #fff;
  box-shadow: 0 5px 14px rgba(255, 138, 61, 0.34);
}
.tab:active { transform: scale(0.96); }

/* Panels */
.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 138, 61, 0.18);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(180, 120, 60, 0.12);
}
.panel.hidden { display: none; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.hint { font-size: 11px; color: #A08A6E; }
.sub-head { margin-top: 18px; }

/* Field */
.field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plot {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 16px; border: 1px solid rgba(150, 110, 60, 0.22);
  background: linear-gradient(170deg, #C9A472, #B08A57);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 4px 10px rgba(120, 80, 40, 0.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px; overflow: hidden;
  transition: transform .12s ease;
}
.plot:active { transform: scale(0.97); }
.plot.empty { background: linear-gradient(170deg, #D6B78C, #BE9A6C); }
.plot.locked { background: repeating-linear-gradient(45deg, #E7DCC8, #E7DCC8 8px, #DED1B9 8px, #DED1B9 16px); border-style: dashed; }
.plot .crop-emoji { font-size: 30px; line-height: 1; }
.plot .pname { font-size: 10px; font-weight: 700; color: #4A3418; text-align: center; }
.plot .ptime { font-size: 10px; font-weight: 700; color: #FFF3DC; background: rgba(60, 40, 20, 0.42); padding: 1px 6px; border-radius: 999px; }
.plot .ready-tag { font-size: 10px; font-weight: 800; color: #fff; background: #4CAF50; padding: 1px 7px; border-radius: 999px; }
.plot .lock-ico { font-size: 22px; color: #A08A6E; }
.plot .plus { font-size: 26px; color: rgba(255, 255, 255, 0.85); }
.plot .bar { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 5px; border-radius: 999px; background: rgba(60, 40, 20, 0.28); overflow: hidden; }
.plot .bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #9BE07A, #4CAF50); transition: width .3s linear; }
.plot.ready { box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 0 0 2px rgba(76, 175, 80, 0.55), 0 6px 16px rgba(76, 175, 80, 0.28); }

/* Seed bar */
.seed-bar { display: flex; gap: 8px; overflow-x: auto; margin-top: 14px; padding-bottom: 2px; }
.seed-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255, 138, 61, 0.3);
  background: #FFF8EC; color: #6B4E2A; font-size: 12px; font-weight: 700; font-family: inherit;
}
.seed-chip.active { background: linear-gradient(160deg, #FFA45C, #FF8A3D); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(255,138,61,.3); }
.seed-chip:active { transform: scale(0.96); }

/* Orders */
.orders { display: flex; flex-direction: column; gap: 10px; }
.order {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 16px;
  background: #FFF8EC; border: 1px solid rgba(214, 150, 60, 0.24);
}
.order .o-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #FFEBCB; font-size: 22px; }
.order .o-main { flex: 1; min-width: 0; }
.order .o-title { font-size: 14px; font-weight: 700; }
.order .o-need { font-size: 11px; color: #9A8368; margin-top: 2px; }
.order .o-reward { font-size: 12px; font-weight: 800; color: #C77A16; margin-top: 3px; display: flex; align-items: center; gap: 3px; }
.order .o-reward .mp-icon { font-size: 14px; }
.btn {
  border: 0; border-radius: 12px; padding: 10px 14px;
  font-family: inherit; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(160deg, #FFA45C, #FF8A3D);
  box-shadow: 0 5px 14px rgba(255, 138, 61, 0.32);
  transition: transform .12s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.95); }
.btn.ghost { background: #F0E6D6; color: #8A6A44; box-shadow: none; }
.btn[disabled] { opacity: .45; box-shadow: none; }
.btn.small { padding: 8px 12px; font-size: 12px; }

/* Shop */
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 16px;
  background: #FFF8EC; border: 1px solid rgba(214, 150, 60, 0.24);
}
.shop-item .s-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #FFEBCB; font-size: 24px; }
.shop-item .s-main { flex: 1; min-width: 0; }
.shop-item .s-name { font-size: 14px; font-weight: 700; }
.shop-item .s-desc { font-size: 11px; color: #9A8368; margin-top: 2px; }
.shop-item .s-price { font-size: 12px; font-weight: 800; color: #C77A16; margin-top: 3px; display: flex; align-items: center; gap: 3px; }
.shop-item .s-price .mp-icon { font-size: 14px; }
.shop-item.owned { opacity: .72; }
.land-box { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: #FFF8EC; border: 1px solid rgba(214, 150, 60, 0.24); }
.land-box .l-main { flex: 1; }
.land-box .l-title { font-size: 14px; font-weight: 700; }
.land-box .l-desc { font-size: 11px; color: #9A8368; margin-top: 2px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  transform: translate(-50%, 16px);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(58, 42, 24, 0.92); color: #FFF6E6;
  font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 80vw; text-align: center; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 农场经营：图标与作物徽章补充样式 */
.plot .crop-emoji { filter: drop-shadow(0 2px 3px rgba(60, 40, 20, 0.25)); }
.seed-chip .mp-icon { font-size: 14px; }
.order .o-ico, .shop-item .s-ico { box-shadow: inset 0 -2px 0 rgba(214, 150, 60, 0.18); }
@media (max-width: 360px) {
  .field { gap: 8px; }
  .plot .crop-emoji { font-size: 24px; }
  .tab { font-size: 12px; }
}
