/**
 * 暖阳农场 · Sunny Pixel Farm
 * 主样式文件 - 星露谷风格
 */

:root {
  /* 星露谷风格配色：明亮、温暖、治愈系 */
  --wood: #a0622a;
  --wood2: #7d4a1f;
  --wood3: #5c3518;
  --woodD: #3d2412;
  --cream: #fffef7;
  --cream2: #f5f0e1;
  --cream3: #e8ddc4;
  --ink: #3e2723;
  --ink2: #6d4c41;
  --grass: #6ec157;
  --grass2: #5fa847;
  --grass3: #4a8c37;
  --gold: #ffd54f;
  --gold2: #ffc107;
  --goldD: #f57f17;
  --leaf: #4caf50;
  --leaf2: #81c784;
  --dirt: #8b6f47;
  --dirt2: #a68a5e;
  --dirt3: #6b5638;
  --sky: #87ceeb;
  --sky2: #b0e0e6;
  --red: #ef5350;
  --redD: #c62828;
  --water: #5dade2;
  --water2: #3498db;
  --shadow: rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: #2e5c3f;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background:
    radial-gradient(ellipse 1000px 600px at 50% 0%, #4a9d5f 0%, transparent 70%),
    linear-gradient(180deg, #2e5c3f 0%, #1a3d2e 50%, #0f2419 100%);
  overflow: hidden;
}

/* ================= 舞台 ================= */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #5da83f;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none   /* 手势全部自己接管：滚轮/双指缩放地图，浏览器不再做页面缩放滚动 */
}

/* ================= 顶部 HUD ================= */
#hud {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 56px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  pointer-events: none;
}

.spacer {
  flex: 1
}

.iconbtn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 254, 247, 0.95);
  border: 3px solid var(--woodD);
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  transition: transform .08s, filter .12s;
  backdrop-filter: blur(4px);
}

.iconbtn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px)
}

.iconbtn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
}

/* ================= 提示气泡 ================= */
#hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 68px;
  z-index: 5;
  background: linear-gradient(180deg, #fffef7 0%, #f5f0e1 100%);
  border: 4px solid var(--woodD);
  border-radius: 14px;
  padding: 10px 44px 10px 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  max-width: 680px;
  text-align: center;
  transition: opacity .3s, transform .3s;
  position: relative;
  backdrop-filter: blur(4px);
}

#hint.hide {
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none
}

#hint::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-top-color: var(--woodD);
  border-bottom: 0;
}

#hintClose {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--redD);
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: filter .12s, transform .08s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#hintClose:hover {
  filter: brightness(1.2);
  transform: translateY(-50%) scale(1.08)
}

/* ================= 底部工具栏：左（种子占一半）+ 中（信息盘）+ 右（操作）================= */
#toolbar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 118px;
  z-index: 6;
  padding: 4px 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(160, 98, 42, 0.95) 0%, rgba(125, 74, 31, 0.95) 60%, rgba(92, 53, 24, 0.95) 100%);
  border-top: 4px solid rgba(61, 36, 18, 0.8);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 235, 190, 0.15);
  backdrop-filter: blur(8px);
}

/* 工具栏内容层：固定按 1280px 标准宽度布局（设计稿基准），
   窗口更窄时由 JS 整体等比缩小，内部布局永远不变形 */
#toolbarInner {
  position: relative;
  flex: 0 0 auto;
  width: 1280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  transform-origin: center bottom
}

.seedbar,
.actbar {
  width: 50%;
}

.seedbar {
  padding-right: 60px;
}

.actbar {
  padding-left: 60px;
}

/* 左：种子栏固定尺寸（2 行 × 5 列，格子 86px），贴左侧 */
.seedbar {
  display: grid;
  grid-template-columns: repeat(6, 86px);
  grid-auto-rows: 50px;
  gap: 5px
}

.slot {
  position: relative;
  height: 53px;
  cursor: pointer;
  background: rgba(255, 254, 247, 0.95);
  border: 2px solid rgba(61, 36, 18, 0.6);
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform .08s, box-shadow .12s, background .15s;
}

.slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

.slot .mini {
  width: 30px;
  height: 30px;
  display: block
}

.slot .nm {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-top: 1px
}

.slot .ct {
  position: absolute;
  right: 2px;
  top: 2px;
  background: var(--goldD);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 6px;
  min-width: 16px;
  text-align: center;
  line-height: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.slot .ct.zero {
  background: #9e9e9e
}

.slot.sel {
  background: linear-gradient(180deg, #fff9e6 0%, #ffe6a8 100%);
  box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(255, 193, 7, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.slot.sel::before {
  content: "▲";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -12px;
  color: var(--gold);
  font-size: 11px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 0 3px var(--gold2));
}

.slot.locked {
  filter: grayscale(.85) brightness(.9);
  cursor: not-allowed
}

/* 神秘作物占位槽：剪影 + 神秘紫色调（覆盖 locked 的灰暗滤镜） */
.slot.mystery {
  filter: none;
  background: linear-gradient(180deg, #f3ecff 0%, #e2d4f7 100%);
  border-style: dashed
}

.slot.mystery .mystery-art {
  filter: brightness(0.12) sepia(1) hue-rotate(210deg) saturate(2.4);
  opacity: .75
}

.slot.mystery .mystery-egg {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  animation: eggBob 1.6s ease-in-out infinite
}

@keyframes eggBob {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-2px)
  }
}

.slot.mystery .nm {
  color: #5b4a7a
}

/* 中：圆形信息盘（默认展示，无需交互）——圆内农夫头像 + 等级，金币徽章挂圆下方 */
#hubWrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2
}

#hub {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: radial-gradient(circle at 50% 32%, #fffef7 0%, #f7efd6 62%, #e4cb96 100%);
  border: 4px solid var(--woodD);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .4), inset 0 2px 0 rgba(255, 255, 255, .7);
}

#hubFace {
  display: block;
  width: 32px;
  height: 48px
}

#hub .lv {
  font-size: 11px;
  font-weight: 700;
  color: var(--leaf);
  letter-spacing: .04em;
  line-height: 1
}

#hub .expbar {
  width: 64px;
  height: 6px
}

#hub .ext {
  font-size: 10px;
  color: var(--ink2);
  letter-spacing: .05em;
  line-height: 1
}

/* 等级徽章：点击打开升级面板；经验攒满待升级时金色发光脉动 */
#hub {
  cursor: pointer
}

#hub.ready {
  border-color: #e8a13a;
  animation: hubGlow 1.6s ease-in-out infinite
}

#hub.ready .ext {
  color: #b07206;
  font-weight: 700
}

@keyframes hubGlow {
  0%, 100% {
    box-shadow: 0 5px 12px rgba(0, 0, 0, .4), 0 0 0 0 rgba(255, 210, 74, .8), inset 0 2px 0 rgba(255, 255, 255, .7)
  }
  50% {
    box-shadow: 0 5px 12px rgba(0, 0, 0, .4), 0 0 0 10px rgba(255, 210, 74, 0), inset 0 2px 0 rgba(255, 255, 255, .7)
  }
}

#hubCoin {
  margin-top: -9px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 254, 247, .97);
  border: 3px solid var(--woodD);
  border-radius: 12px;
  padding: 1px 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
  z-index: 3;
}

#hubCoin .ic {
  width: 15px;
  height: 15px;
  display: block
}

#hubCoin b {
  font-size: 13px;
  font-weight: 700;
  color: var(--goldD);
  font-variant-numeric: tabular-nums
}

.expbar {
  height: 6px;
  background: rgba(62, 39, 35, 0.15);
  border: 1px solid rgba(62, 39, 35, 0.25);
  border-radius: 4px;
  overflow: hidden
}

.expbar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--leaf2), var(--leaf));
  transition: width .45s ease-out;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4)
}

/* 右：两行固定尺寸按钮（右对齐，第一排 100px 一键操作，第二排 94px 功能键） */
.actbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px
}

.actRow {
  display: flex;
  gap: 5px
}

.abtn {
  position: relative;
  width: 80px;
  height: 53px;
  cursor: pointer;
  border: 2px solid rgba(61, 36, 18, 0.6);
  border-radius: 8px;
  background: rgba(255, 254, 247, 0.95);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform .08s, filter .12s;
}

.abtn:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

.abtn:active {
  transform: translateY(1px)
}

.abtn .e {
  font-size: 17px;
  line-height: 1
}

.abtn .t {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink)
}

/* 一键操作的 2 秒进度条 */
.abtn .prog {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 1;
}

.abtn.busy {
  pointer-events: none
}

.abtn.busy .e,
.abtn.busy .t {
  opacity: .55
}

.abtn .badge {
  position: absolute;
  right: -4px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--red);
  border: 2px solid var(--woodD);
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.abtn .badge.hide {
  display: none
}

/* 可买升级时改为静态金色高亮，避免无休止的爆闪 */
.abtn.hot {
  border-color: var(--goldD);
  background: linear-gradient(180deg, #fffef7 0%, #ffedb8 100%)
}

/* 一键按钮无对应可操作对象时置灰（仍可点击，点了会提示原因） */
.abtn.off {
  opacity: .45;
  filter: grayscale(.85)
}

.abtn.off:hover {
  filter: grayscale(.85);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

.abtn.off:active {
  transform: none
}

/* 一键任务进行中：锁定操作栏其余按钮，防止并发操作打乱状态 */
#toolbar.tasklock .actbar .abtn:not(.busy) {
  pointer-events: none;
  opacity: .55;
  filter: grayscale(.6)
}

/* 一键种植进行中：锁定种子栏，不可切换农作物 */
#seedbar.seedlock {
  pointer-events: none;
  opacity: .55;
  filter: grayscale(.55)
}

/* 加工坊队列的进度条 */
.pbar {
  height: 9px;
  border-radius: 5px;
  background: #ece0c2;
  border: 1px solid #cdbb8e;
  overflow: hidden;
  margin: 5px 0 3px
}

.pbar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: width .3s linear
}

/* ================= 弹窗面板 ================= */
#overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(20, 40, 30, .65);
  display: grid;
  place-items: center;
  transition: opacity .18s;
  backdrop-filter: blur(2px);
}

#overlay.hide {
  display: none
}

#panel {
  /* 大屏维持 720×560 上限；小屏（手机横屏）宽高自动收缩到几乎占满一屏，绝不溢出。
     用视口单位 100vw/100vh：父级是 grid 自动轨道，百分比高度会退化成内容高度 */
  width: min(800px, calc(100vw - 12px));
  height: min(560px, calc(100vh - 12px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffef7 0%, #f5f0e1 100%);
  border: 5px solid var(--woodD);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
  animation: popIn .25s cubic-bezier(.2, 1.5, .5, 1);
}

@keyframes popIn {
  0% {
    transform: scale(.85);
    opacity: 0
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

#panelHead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--wood) 0%, var(--wood2) 100%);
  border-bottom: 4px solid var(--woodD);
  border-radius: 11px 11px 0 0;
  color: var(--cream);
  box-shadow: inset 0 2px 0 rgba(255, 235, 190, 0.25);
}

#panelHead .pe {
  font-size: 22px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3))
}

#panelHead h2 {
  font-size: 17px;
  letter-spacing: .12em;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.4)
}

#panelHead .coin {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 254, 247, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2)
}

#panelHead .coin .ic {
  width: 22px;
  height: 22px
}

#panelClose {
  width: 32px;
  height: 32px;
  margin-left: 8px;
  cursor: pointer;
  color: var(--cream);
  background: var(--redD);
  border: 3px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: filter .12s, transform .08s;
}

#panelClose:hover {
  filter: brightness(1.15);
  transform: scale(1.05)
}

#panelClose:active {
  transform: scale(0.95)
}

#panelBody {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  background: rgba(255, 254, 247, 0.5)
}

#panelBody::-webkit-scrollbar {
  width: 12px
}

#panelBody::-webkit-scrollbar-track {
  background: rgba(232, 221, 196, 0.5);
  border-radius: 6px
}

#panelBody::-webkit-scrollbar-thumb {
  background: var(--wood2);
  border: 2px solid var(--woodD);
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2)
}

#panelBody::-webkit-scrollbar-thumb:hover {
  background: var(--wood)
}

.sub {
  font-size: 12px;
  color: var(--ink2);
  margin: 3px 0 10px;
  line-height: 1.7
}

.sub b {
  color: var(--redD)
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  margin-bottom: 8px;
  background: #fff;
  border: 3px solid rgba(62, 39, 35, 0.15);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform .08s, box-shadow .12s;
}

.row:hover {
  transform: translateX(2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12)
}

.row .ric {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(245, 240, 225, 0.8);
  border: 2px solid rgba(62, 39, 35, 0.1);
  border-radius: 10px
}

.row .ric .mini {
  width: 40px;
  height: 40px;
  display: block
}

.row .info {
  flex: 1;
  min-width: 0
}

.row .nm {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink)
}

.row .ds {
  font-size: 11px;
  color: var(--ink2);
  margin-top: 3px;
  line-height: 1.5
}

.row .ds .g {
  color: var(--goldD);
  font-weight: 700
}

.row .ds .r {
  color: var(--redD);
  font-weight: 700
}

.row .own {
  font-size: 11px;
  color: var(--ink2)
}

.pbtn {
  cursor: pointer;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--leaf2), var(--leaf));
  border: 3px solid #2d7a2f;
  border-radius: 10px;
  box-shadow: 0 3px 0 #2d7a2f, inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform .07s, filter .12s;
  white-space: nowrap;
  font-family: inherit;
}

.pbtn:hover {
  filter: brightness(1.1)
}

.pbtn:active {
  transform: translateY(3px);
  box-shadow: none
}

.pbtn.gold {
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  border-color: var(--goldD);
  box-shadow: 0 3px 0 var(--goldD), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #3d2a06
}

.pbtn.grey {
  background: linear-gradient(180deg, #ccc0aa, #a99b84);
  border-color: #7a6d59;
  box-shadow: 0 3px 0 #7a6d59, inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #4a4038
}

.pbtn:disabled {
  cursor: not-allowed;
  filter: grayscale(.8) brightness(.92);
  box-shadow: 0 3px 0 #6b6154
}

.pbtn:disabled:active {
  transform: none
}

.pbtn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px
}

.bgroup {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px
}

.tab {
  cursor: pointer;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: rgba(245, 240, 225, 0.8);
  border: 3px solid rgba(62, 39, 35, 0.2);
  border-radius: 10px;
  color: var(--ink2);
  transition: all .15s;
}

.tab:hover {
  background: rgba(255, 254, 247, 0.95)
}

.tab.on {
  background: linear-gradient(180deg, var(--wood), var(--wood2));
  color: var(--cream);
  border-color: var(--woodD);
  box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.2)
}

.empty {
  text-align: center;
  color: var(--ink2);
  font-size: 13px;
  padding: 30px 0;
  line-height: 1.9
}

/* 升级面板分区标题：金色竖条 + 虚线延伸 */
.sect {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .05em
}

.sect::before {
  content: '';
  flex: none;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--goldD))
}

.sect::after {
  content: '';
  flex: 1;
  border-top: 2px dashed rgba(62, 39, 35, 0.16);
  margin-left: 2px
}

/* 升级卡片 */
.upgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.upcard {
  background: #fff;
  border: 3px solid rgba(62, 39, 35, 0.15);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform .08s, box-shadow .12s;
}

.upcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12)
}

.upcard .uh {
  display: flex;
  align-items: center;
  gap: 9px
}

/* 图标瓷砖：奶油底座衬托 emoji */
.upcard .uic {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: linear-gradient(180deg, #fffef7, var(--cream2));
  border: 2px solid rgba(62, 39, 35, 0.18);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.08)
}

.upcard .un {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3
}

/* 标题内的进度/等级小签：土地扩建 1/18、洒水器 Lv.1 → 2 */
.upcard .un .step {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--wood2);
  background: rgba(160, 98, 42, 0.12);
  border-radius: 7px;
  padding: 1px 6px;
  margin-left: 2px;
  vertical-align: 1px
}

.upcard .ud {
  font-size: 11px;
  color: var(--ink2);
  line-height: 1.6;
  flex: 1
}

.upcard .uf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 2px
}

/* 价格签：金=买得起，红=差金币，灰=条件未满足 */
.price {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9px;
  white-space: nowrap;
  border: 2px solid transparent
}

.price.ok {
  color: var(--goldD);
  background: #fff6d8;
  border-color: rgba(245, 127, 23, 0.35)
}

.price.no {
  color: var(--redD);
  background: #fdecec;
  border-color: rgba(198, 40, 40, 0.3)
}

.price.warn {
  color: var(--ink2);
  background: var(--cream2);
  border-color: rgba(62, 39, 35, 0.18)
}

/* 品质色块：行内预览土色变化 */
.qswatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 2px solid rgba(62, 39, 35, 0.35);
  vertical-align: -1px;
  margin: 0 1px
}

.upcard.done {
  border-color: var(--leaf);
  background: linear-gradient(180deg, #f0fbea 0%, #e8f5e0 100%);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.15)
}

.upcard .owned {
  font-size: 12px;
  font-weight: 700;
  color: #2d7a2f
}

/* 农场等级通栏卡：徽章 + 经验进度 + 支付动作 */
.lvcard {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 4px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffbe8 0%, #fff3c9 100%);
  border: 3px solid rgba(245, 127, 23, 0.35);
  border-radius: 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden
}

.lvcard::after {
  content: '⭐';
  position: absolute;
  right: -12px;
  bottom: -18px;
  font-size: 72px;
  opacity: .07;
  pointer-events: none
}

.lvcard.ready {
  border-color: var(--goldD);
  animation: lvGlow 1.8s ease-in-out infinite
}

@keyframes lvGlow {
  0%, 100% {
    box-shadow: 0 2px 5px rgba(0, 0, 0, .08), 0 0 0 0 rgba(255, 210, 74, .6)
  }
  50% {
    box-shadow: 0 2px 5px rgba(0, 0, 0, .08), 0 0 0 9px rgba(255, 210, 74, 0)
  }
}

.lvcard.done {
  background: linear-gradient(180deg, #f0fbea 0%, #e8f5e0 100%);
  border-color: var(--leaf)
}

.lvface {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: radial-gradient(circle at 50% 30%, #fffef7 0%, #f7efd6 70%);
  border: 3px solid var(--woodD);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7)
}

.lvcard.done .lvface {
  border-color: #2d7a2f
}

.lvface b {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  border: 2px solid var(--goldD);
  color: #3d2a06;
  white-space: nowrap
}

.lvmain {
  flex: 1;
  min-width: 0;
  position: relative
}

.lvtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink)
}

.lvtag {
  font-size: 11px;
  padding: 2px 8px;
  margin-left: 4px;
  border-radius: 8px;
  background: rgba(160, 98, 42, 0.12);
  color: var(--wood2);
  vertical-align: 1px;
  white-space: nowrap
}

.lvbar {
  height: 10px;
  margin: 7px 0 5px;
  border-radius: 6px;
  background: #ead9b0;
  border: 2px solid rgba(62, 39, 35, 0.22);
  overflow: hidden
}

.lvbar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  transition: width .35s
}

/* 经验攒满：金条流动 + 整卡呼吸 */
.lvcard.ready .lvbar i {
  background: repeating-linear-gradient(45deg, var(--gold) 0 9px, var(--gold2) 9px 18px);
  animation: barFlow .9s linear infinite
}

@keyframes barFlow {
  to {
    background-position: 25.46px 0
  }
}

.lvmeta {
  font-size: 11px;
  color: var(--ink2);
  line-height: 1.5
}

.lvmeta b {
  color: var(--goldD)
}

.lvact {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  position: relative
}

.lvact .price {
  text-align: center
}

.lvact .owned {
  font-size: 13px;
  font-weight: 700;
  color: #2d7a2f;
  text-align: center
}

/* 设置 */
.field {
  margin-bottom: 12px
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px
}

.field textarea {
  width: 100%;
  height: 110px;
  resize: vertical;
  padding: 9px;
  font-family: inherit;
  font-size: 12px;
  background: #fff;
  border: 3px solid rgba(62, 39, 35, 0.15);
  border-radius: 10px;
  color: var(--ink2);
  line-height: 1.6;
  transition: border-color .15s;
}

.field textarea:focus {
  outline: none;
  border-color: var(--wood);
  box-shadow: 0 0 0 3px rgba(160, 98, 42, 0.15)
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  transition: opacity .15s
}

.switch:hover {
  opacity: 0.85
}

.switch .track {
  width: 50px;
  height: 28px;
  border-radius: 14px;
  background: #ccc0aa;
  border: 3px solid rgba(62, 39, 35, 0.3);
  position: relative;
  transition: background .2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15)
}

.switch .track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .2s
}

.switch.on .track {
  background: linear-gradient(180deg, var(--leaf2), var(--leaf))
}

.switch.on .track i {
  transform: translateX(22px)
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px
}

.stat {
  background: #fff;
  border: 3px solid rgba(62, 39, 35, 0.15);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08)
}

.stat b {
  display: block;
  font-size: 18px;
  color: var(--goldD);
  font-weight: 700
}

.stat span {
  font-size: 11px;
  color: var(--ink2);
  letter-spacing: .08em
}

/* ================= 飘字 / 提示 ================= */
#toasts {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none
}

.toast {
  background: rgba(255, 254, 247, 0.98);
  border: 4px solid var(--woodD);
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: tIn .25s ease-out, tOut .35s ease-in 1.8s forwards;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.toast.good {
  background: rgba(234, 255, 226, 0.98);
  border-color: #2d7a2f;
  color: #1b5e1d;
  box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

.toast.bad {
  background: rgba(255, 230, 226, 0.98);
  border-color: var(--redD);
  color: var(--redD);
  box-shadow: 0 6px 12px rgba(239, 83, 80, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

.toast.gold {
  background: rgba(255, 245, 214, 0.98);
  border-color: var(--goldD);
  color: #7a5406;
  box-shadow: 0 6px 12px rgba(255, 193, 7, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

@keyframes tIn {
  0% {
    transform: translateY(-18px) scale(.9);
    opacity: 0
  }

  100% {
    transform: none;
    opacity: 1
  }
}

@keyframes tOut {
  to {
    transform: translateY(-14px);
    opacity: 0
  }
}

#banner {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(.7);
  z-index: 31;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

#banner.show {
  animation: bannerIn 2.6s cubic-bezier(.2, 1.4, .4, 1) forwards
}

@keyframes bannerIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.6)
  }

  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08)
  }

  22% {
    transform: translate(-50%, -50%) scale(1)
  }

  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1)
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -88%) scale(1)
  }
}

#banner .bt {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 100%);
  border: 5px solid var(--woodD);
  border-radius: 16px;
  color: #3d2a06;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .14em;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .6);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .5), 0 0 20px rgba(255, 213, 79, 0.8);
}

#banner .bs {
  margin-top: 10px;
  display: inline-block;
  padding: 6px 20px;
  background: rgba(255, 254, 247, 0.98);
  border: 4px solid var(--woodD);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, 0.5)
}

/* ================= 场景内 SVG 动画 ================= */
.sprite {
  shape-rendering: crispEdges
}

.sway {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sway 3.4s ease-in-out infinite alternate
}

@keyframes sway {
  0% {
    transform: rotate(-2.2deg)
  }

  100% {
    transform: rotate(2.2deg)
  }
}

.sway.slow {
  animation-duration: 5s
}

.cloud {
  animation: drift linear infinite
}

@keyframes drift {
  0% {
    transform: translateX(-260px)
  }

  100% {
    transform: translateX(1240px)
  }
}

.sunrays {
  transform-box: view-box;
  transform-origin: 838px 104px;
  animation: spin 70s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.blades {
  transform-box: view-box;
  transform-origin: 858px 268px;
  animation: spin 13s linear infinite
}

.smoke {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: smoke 3.6s ease-out infinite
}

@keyframes smoke {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(.4)
  }

  18% {
    opacity: .75
  }

  100% {
    opacity: 0;
    transform: translate(16px, -46px) scale(1.5)
  }
}

/* 成熟提示 ✨ 改为缓慢呼吸，不再高频闪跳；fill-box 让缩放绕自身中心，贴住作物不乱飘 */
.twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 3s ease-in-out infinite
}

@keyframes twinkle {

  0%,
  100% {
    opacity: .45;
    transform: scale(.94)
  }

  50% {
    opacity: 1;
    transform: scale(1.04)
  }
}

.grasssway {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sway 2.6s ease-in-out infinite alternate
}

.markRing {
  transform-box: fill-box;
  transform-origin: center;
  animation: markPulse .95s ease-out infinite
}

@keyframes markPulse {
  0% {
    transform: scale(.55);
    opacity: 1
  }

  100% {
    transform: scale(1.7);
    opacity: 0
  }
}

.fxtxt {
  text-anchor: middle;
  font-size: 15px;
  font-weight: 700;
  fill: var(--cream);
  stroke: var(--woodD);
  stroke-width: 3.5;
  paint-order: stroke;
  stroke-linejoin: round;
  font-family: inherit;
  animation: floatUp 1.25s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(4px)
  }

  18% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: translateY(-50px)
  }
}

.fxtxt.gold {
  fill: var(--gold)
}

.puff {
  animation: puffOut .75s ease-out forwards
}

@keyframes puffOut {
  0% {
    opacity: .95;
    transform: translateY(0) scale(.5)
  }

  100% {
    opacity: 0;
    transform: translateY(-16px) scale(1.5)
  }
}

.drop {
  animation: dropFall .7s ease-in forwards
}

@keyframes dropFall {
  0% {
    opacity: 0;
    transform: translateY(0)
  }

  25% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: translateY(26px)
  }
}

.pop {
  animation: popSpark .6s ease-out forwards
}

@keyframes popSpark {
  0% {
    opacity: 0;
    transform: translateY(0) scale(.4)
  }

  30% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1.1)
  }
}

.plotpl {
  transition: filter .3s
}

/* 成熟地块：静态柔光，替代原先的亮度爆闪 */
.plotpl.ripe {
  filter: drop-shadow(0 0 6px rgba(255, 214, 74, .5))
}

/* ================= 变异作物 =================
   变异株的外观由四层叠加：精灵整株换色（js 按变异调色板重算）、
   地面径向渐变柔光 + 扩散能量环 + 上浮光点，以及地块上方的变异徽章。
   颜色一律由 refreshPlot 按变异类型写入，这里只负责动效。 */
.mutAura {
  transform-box: fill-box;
  transform-origin: center;
  animation: mutAura 3.2s ease-in-out infinite
}

@keyframes mutAura {

  0%,
  100% {
    opacity: .5;
    transform: scale(.95)
  }

  50% {
    opacity: 1;
    transform: scale(1.05)
  }
}

/* 能量环：由内向外扩散后消散，循环往复，像地面在持续吐息 */
.mutRing {
  transform-box: fill-box;
  transform-origin: center;
  animation: mutRing 2.8s ease-out infinite
}

@keyframes mutRing {
  0% {
    transform: scale(.6);
    opacity: 0
  }

  20% {
    opacity: .62
  }

  100% {
    transform: scale(1.28);
    opacity: 0
  }
}

/* 上浮光点：两粒错开半拍，让特别株一直「活着」
   （rect 默认以用户空间原点缩放，必须用 fill-box 把变形原点拉回自身） */
.mutSpark {
  transform-box: fill-box;
  transform-origin: center;
  animation: mutSpark 2.4s ease-out infinite
}

.mutSpark.sk2 {
  animation-delay: 1.1s
}

@keyframes mutSpark {
  0% {
    transform: translateY(5px) scale(.5);
    opacity: 0
  }

  30% {
    opacity: 1
  }

  100% {
    transform: translateY(-15px) scale(1);
    opacity: 0
  }
}

/* 变异徽章：挂在地块上方的小圆牌，轻微浮动 */
.mutbadge {
  transform-box: fill-box;
  transform-origin: center;
  animation: mutBadge 2.6s ease-in-out infinite
}

@keyframes mutBadge {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-2.5px)
  }
}

/* 虹彩：光环与能量环的色相同步流转，和植株保持一体 */
.mutfx.rainbow .mutAura {
  animation: mutAura 3.2s ease-in-out infinite, hueFlow 6s linear infinite
}

.mutfx.rainbow .mutRing {
  animation: mutRing 2.8s ease-out infinite, hueFlow 6s linear infinite
}

/* 成熟变异株：光环整体提亮，别被成熟的丰收光晕盖过去 */
.plotpl.mut.ripe .mutfx {
  filter: brightness(1.25)
}

/* 变异触发的爆发环：两圈错开扩散 */
.mutburst {
  transform-box: fill-box;
  transform-origin: center;
  animation: mutBurstRing .95s cubic-bezier(.2, .7, .3, 1) forwards
}

@keyframes mutBurstRing {
  0% {
    transform: scale(.25);
    opacity: 0
  }

  15% {
    opacity: 1
  }

  100% {
    transform: scale(2.15);
    opacity: 0
  }
}

/* 各变异主题的植株辉光（与精灵换色同色系，弱化到不喧宾夺主） */
.sway.mut-giant {
  filter: drop-shadow(0 2px 3px rgba(46, 92, 30, .5))
}

.sway.mut-swift {
  filter: drop-shadow(0 0 5px rgba(125, 211, 252, .75))
}

.sway.mut-lush {
  filter: drop-shadow(0 0 5px rgba(255, 158, 196, .75))
}

.sway.mut-golden {
  filter: drop-shadow(0 0 6px rgba(255, 210, 74, .8))
}

/* 虹彩变异：色相在整株上循环流转（与摇摆动画并存，两者互不干扰） */
.sway.mut-rainbow {
  animation: sway 3.4s ease-in-out infinite alternate, hueFlow 6s linear infinite
}

@keyframes hueFlow {
  from {
    filter: hue-rotate(0deg) saturate(1.3)
  }

  to {
    filter: hue-rotate(360deg) saturate(1.3)
  }
}

/* 变异触发飘字：比普通飘字更大更亮，稀有事得看得见 */
.fxtxt.mut {
  font-size: 19px;
  fill: #fff3b0
}

/* ================= 竖屏提示 ================= */
#rotate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(#1d2b1a, #0d1409);
  display: none;
  place-items: center;
  text-align: center;
  color: var(--cream);
  padding: 30px;
}

#rotate.show {
  display: grid
}

#rotate .box {
  background: var(--wood2);
  border: 5px solid var(--woodD);
  border-radius: 16px;
  padding: 26px 15px
}

#rotate .ph {
  font-size: 54px;
  animation: rot 2.2s ease-in-out infinite
}

@keyframes rot {

  0%,
  40% {
    transform: rotate(0)
  }

  60%,
  100% {
    transform: rotate(90deg)
  }
}

#rotate h3 {
  font-size: 17px;
  margin: 14px 0 6px;
  letter-spacing: .1em
}

#rotate p {
  font-size: 12px;
  color: #e6cfa4;
  line-height: 1.7
}
/* ================= 昼夜光照层 ================= */
/* multiply 混合：正午纯白无变化，傍晚偏暖，夜晚压暗偏蓝。
   每现实秒由时钟更新颜色，配 1s 过渡实现平滑渐变 */
#lightVeil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  background: #fff;
  z-index: 4
}

/* ================= 左上角：地图按钮 + 时间牌 ================= */
#topLeft {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  gap: 8px;
  align-items: stretch;
  z-index: 15
}

#topLeft .iconbtn {
  width: 42px;
  height: 42px
}

#clockBox {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: rgba(255, 254, 247, 0.95);
  border: 3px solid var(--woodD);
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 15px;
  color: var(--ink)
}

#clockSeason {
  font-size: 18px;
  line-height: 1
}

#clockDay {
  font-weight: 800
}

#clockTime {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #6b4423;
  background: #f3e7c9;
  border-radius: 7px;
  padding: 2px 7px
}

/* ================= 氛围粒子 ================= */
/* 飘落物：下落为主 + 横向摆动；萤火虫：缓慢漂移 + 闪烁 */
@keyframes ambFall {
  from {
    transform: translateY(0)
  }

  to {
    transform: translateY(2300px)
  }
}

/* SVG 内用独立 translate 属性做横向摆动，与 transform 的下落叠加 */
@keyframes ambSway {

  0%,
  100% {
    translate: 0 0
  }

  50% {
    translate: 26px 0
  }
}

@keyframes fireflyFly {
  0% {
    transform: translate(0, 0);
    opacity: 0
  }

  15% {
    opacity: 1
  }

  30% {
    transform: translate(30px, -34px)
  }

  60% {
    transform: translate(-24px, -70px);
    opacity: .9
  }

  85% {
    opacity: .2
  }

  100% {
    transform: translate(18px, -110px);
    opacity: 0
  }
}

.amb-snow,
.amb-leaf,
.amb-petal {
  animation: ambFall linear forwards, ambSway ease-in-out infinite alternate
}

.amb-snow {
  opacity: .9
}

.amb-leaf,
.amb-petal {
  opacity: .85
}

.amb-snow {
  animation-duration: 7s, 2.4s
}

.amb-leaf {
  animation-duration: 6.5s, 1.9s
}

.amb-petal {
  animation-duration: 8s, 2.8s
}

.amb-firefly {
  animation: fireflyFly 5s ease-in-out forwards;
  filter: drop-shadow(0 0 4px #ffe98a)
}

/* 市场：未知作物占位卡 */
.row.mystery-row {
  background: linear-gradient(180deg, #f3ecff 0%, #e6d9f8 100%);
  border-style: dashed;
  border-color: #9a86c4
}

.row.mystery-row .nm {
  color: #5b4a7a
}

/* ================= 农场资料面板 ================= */
.pgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 6px
}

.pstat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fffaf0;
  border: 2px solid var(--cream3, #e8dcc0);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px
}

.pstat span {
  color: #8a7350
}

.pstat b {
  color: var(--ink);
  text-align: right
}

/* ================= 设置面板：左右布局 ================= */
/* 面板占满弹窗内容区：上部滚动、底部保存栏固定不随滚动 */
.setpanel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0
}

.setscroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px
}

.setwrap {
  display: flex;
  gap: 10px;
  min-height: 320px
}

.setnav {
  flex: 0 0 auto;
  width: 140px;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.setnavitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fffaf0;
  border: 2px solid #e8dcc0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #8a7350;
  transition: border-color .12s, background .12s
}

.setnavitem .ic {
  font-size: 16px
}

.setnavitem:hover {
  border-color: var(--gold)
}

.setnavitem.active {
  background: #fff5d6;
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.25)
}

.setbody {
  flex: 1;
  min-width: 0
}

.setfoot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px dashed #e8dcc0
}

.settip {
  font-size: 11px;
  color: #a08a60
}

/* 设置面板内的单行输入框 */
.field input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 8px 10px;
  border: 2px solid #e8dcc0;
  border-radius: 8px;
  font: inherit;
  background: #fffaf0;
  color: var(--ink)
}

.field input:focus {
  outline: none;
  border-color: var(--gold)
}

/* WebDAV 云端存档列表 */
.wdlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px
}

.wditem {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffaf0;
  border: 2px solid #e8dcc0;
  border-radius: 9px;
  padding: 7px 10px
}

.wditem .nm {
  font-weight: 700;
  font-size: 12px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.wditem .tm {
  font-size: 10px;
  color: #a08a60;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.wdempty {
  font-size: 12px;
  color: #a08a60;
  background: #fffaf0;
  border: 2px dashed #e8dcc0;
  border-radius: 9px;
  padding: 12px;
  text-align: center
}

.aboutlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #6b5a3e;
  margin-top: 6px
}

/* ================= 手机端虚拟摇杆（仅触摸设备显示） ================= */
#joyBase {
  display: none;
  position: absolute;
  left: 22px;
  bottom: 126px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255, 254, 247, 0.14);
  border: 3px solid rgba(255, 254, 247, 0.32);
  z-index: 8;
  touch-action: none;
  align-items: center;
  justify-content: center
}

#joyKnob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 254, 247, 0.55);
  border: 3px solid rgba(61, 36, 18, 0.35);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  pointer-events: none
}

/* 仅触摸设备（手机/平板）显示摇杆 */
@media (pointer: coarse) {
  #joyBase {
    display: flex
  }
}

/* ================= 农作物悬停浮窗（仅 PC 鼠标） ================= */
#cropTip {
  position: fixed;
  z-index: 19;
  min-width: 196px;
  max-width: 252px;
  background: var(--cream);
  border: 3px solid var(--woodD);
  border-radius: 10px;
  padding: 9px 12px 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .6);
  pointer-events: none;
  animation: ctipIn .16s ease-out
}

#cropTip.hide {
  display: none
}

.ctipHead {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 5px
}

.ctipHead svg {
  width: 22px;
  height: 22px;
  flex: none
}

.ctipStage {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #7cb342;
  border-radius: 8px;
  padding: 1px 8px;
  white-space: nowrap
}

.ctipStage.ripe {
  background: var(--goldD)
}

/* 浮窗标题旁的变异标签（颜色按变异类型动态写入） */
.ctipMut {
  font-size: 11px;
  font-weight: 800;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  padding: 0 6px;
  white-space: nowrap
}

/* ================= 变异图鉴（农场资料） ================= */
.mutlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px
}

.mutrow {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fffaf0;
  border: 2px solid var(--cream3, #e8dcc0);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
  opacity: .72
}

/* 已触发过的变异恢复正常对比度，未触发的压暗成「待解锁」观感 */
.mutrow.got {
  opacity: 1;
  background: #fff7e4;
  border-color: var(--gold)
}

.mutrow .muic {
  font-size: 19px;
  flex: none
}

.mutrow .muinfo {
  flex: 1;
  color: #6b5a3e;
  line-height: 1.45
}

.mutrow .muinfo b {
  color: var(--ink);
  margin-right: 6px
}

.mutrow .muinfo i {
  color: #a08a63;
  font-style: normal;
  font-size: 11px;
  margin-left: 6px
}

.mutrow .munum {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--goldD, #8a6410)
}

.ctipBar {
  height: 8px;
  background: #d7ccb2;
  border-radius: 5px;
  overflow: hidden;
  margin: 3px 0 5px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18)
}

.ctipBar i {
  display: block;
  height: 100%;
  background: linear-gradient(#ffd75e, #f5b62e);
  border-radius: 5px;
  transition: width .3s
}

.ctipRemain {
  font-weight: 700;
  color: var(--ink2);
  margin-bottom: 6px
}

.ctipRow {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px dashed #d9cba8;
  padding: 2px 0
}

.ctipRow span {
  color: var(--ink2);
  flex: none
}

.ctipRow b {
  font-weight: 700;
  text-align: right
}

@keyframes ctipIn {
  from {
    opacity: 0;
    transform: translateY(4px)
  }

  to {
    opacity: 1;
    transform: none
  }
}
