/* ══════════════════════════════════════════════════════════════════════════
   开心农场 · 页面样式
   ──────────────────────────────────────────────────────────────────────────
   🔴 界面风格（服主 2026-11-15 定）：统一成 Minecraft 原版 GUI 的样子。

   做法：外观部分全部走 `gui.css` 提供的皮肤类（mc-panel / mc-btn / mc-slot
   / mc-progress / mc-title …），这个文件只管**本页特有的布局**，
   不再自己定义配色、圆角、阴影 —— 否则四个页面早晚长得不一样。

   ⚠️ 这里刻意没有 `border-radius`：原版 GUI 全是硬边矩形，一加圆角就不像了。
   ══════════════════════════════════════════════════════════════════════════ */

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

body {
  /* MC 默认观感：草地绿。
     ⚠️ 不要用 multiply 混合 —— 试过，整件页面暗成一团，连面板都看不清。
        底色与入口页保持一致，两个页面来回切换时不会觉得是两个站。 */
  background-color: #5d9b3f;
  background-image: url("assets/mc/block_grass_block_top.png");
  background-size: 96px 96px;
  color: #e0e0e0;
  font-family: var(--mc-font);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0 0 46px;
  image-rendering: pixelated;
}

/* ── 顶栏 ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: #2b2b2b;
  border-bottom: 2px solid #000;
  box-shadow: inset 0 -2px 0 #4a4a4a;
  position: sticky;
  top: 0;
  z-index: 50;
}

.face {
  width: 36px; height: 36px; flex: 0 0 36px;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #5a5a5a;
  overflow: hidden;
  background: #1a1a1a;
}
.face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.who { display: flex; flex-direction: column; gap: 0; }
.who .n {
  font-size: 13.5px; font-weight: 700; color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
}
.who .lv { font-size: 11px; color: #a0a0a0; text-shadow: 1px 1px 0 #1a1a1a; }

/* 顶部数据块 */
.stat-block {
  display: flex; align-items: center; gap: 6px;
  background: #1a1a1a;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #4a4a4a;
  padding: 4px 10px;
}
.stat-block img { width: 16px; height: 16px; }
.stat-block b {
  color: var(--mc-yellow); font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 0 #3f3f3f;
}
.stat-block small { color: #a0a0a0; font-size: 10.5px; text-shadow: 1px 1px 0 #1a1a1a; }

.topbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ── 主体两栏 ── */
.shell {
  max-width: 2160px;
  margin: 0 auto;
  padding: 14px 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.shell > * { min-width: 0; }

/* ── 榜首横条 ── */
.champ {
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  max-width: 100%;
  background: #2b2b2b;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #4a4a4a;
}
.champ-title {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px 0 4px;
  font-size: 12px; font-weight: 700;
  color: var(--mc-gold);
  text-shadow: 2px 2px 0 #1a1a1a;
  white-space: nowrap;
  border-right: 2px solid #4a4a4a;
  margin-right: 4px;
}
.champ-title img { width: 16px; height: 16px; }
.champ-item {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  background: #3a3a3a;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #5a5a5a;
  padding: 3px 8px 3px 4px;
  white-space: nowrap;
}
.champ-item .av {
  width: 22px; height: 22px;
  border: 1px solid #000;
  overflow: hidden; display: grid; place-items: center;
  background: #1a1a1a;
}
.champ-item .av img { width: 100%; height: 100%; image-rendering: pixelated; }
.champ-item .t { display: flex; flex-direction: column; line-height: 1.25; }
.champ-item .t b { font-size: 11px; color: #e0e0e0; font-weight: 600; text-shadow: 1px 1px 0 #1a1a1a; }
.champ-item .t small { font-size: 9.5px; color: #909090; text-shadow: 1px 1px 0 #1a1a1a; }
.champ-item .v { color: var(--mc-gold); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.champ-item .v em { font-style: normal; color: #909090; font-size: 9.5px; }

/* ── 农场主卡 ── */
.farm-card { margin-bottom: 12px; }

/* 作物展示区：一块耕地，作物长在上面 */
.farm-stage {
  position: relative;
  min-height: 200px;
  /* 草地绿 + 纹理 */
  background-color: #4a7a34;
  background-image: url("assets/mc/block_grass_block_top.png");
  background-size: 32px 32px;
  background-blend-mode: multiply;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding: 26px 20px 34px;
  overflow: hidden;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--mc-border);
}
.farm-stage::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
  background-image: url("assets/mc/block_grass_block_side.png");
  background-size: 32px 32px;
  opacity: .9;
}

/* 一块地：原版耕地 + 作物 */
.stage-crop {
  position: relative;
  width: 102px; height: 102px;
  cursor: pointer;
  background-image: url("assets/mc/block_farmland.png");
  background-size: 102px 102px;
  image-rendering: pixelated;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.18), inset -2px -2px 0 rgba(0,0,0,.35);
  transition: none;
}
.stage-crop:hover { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #000; }

.stage-crop > img.crop {
  position: absolute;
  left: 50%; bottom: 11px;
  transform: translateX(-50%);
  width: 88px; height: 88px;
  image-rendering: pixelated;
  pointer-events: none;
}

/* 成熟：换湿润耕地 + 金色描边（不加柔光，原版没有柔光） */
.stage-crop.ready {
  background-image: url("assets/mc/block_farmland_moist.png");
  border-color: #ffcc00;
  box-shadow: inset 0 0 0 2px #ffcc00, 0 0 0 2px #000;
  animation: mc-ready-blink 1.2s steps(2) infinite;
}
@keyframes mc-ready-blink {
  0%, 100% { box-shadow: inset 0 0 0 2px #ffcc00, 0 0 0 2px #000; }
  50%      { box-shadow: inset 0 0 0 2px #fff5aa, 0 0 0 2px #000; }
}

/* 数量角标：原版物品栏那种白字黑影 */
.stage-crop .cnt {
  position: absolute; right: 1px; top: 0;
  font-size: 13px; font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

/* 生长进度：原版经验条样式 */
.stage-crop .prog {
  position: absolute; left: 3px; right: 3px; bottom: 3px;
  height: 6px;
  background: #3f3f3f;
  border: 1px solid #1a1a1a;
  overflow: hidden;
}
.stage-crop .prog > i {
  display: block; height: 100%;
  background: #80ff20;
  box-shadow: inset 0 1px 0 #b0ff80;
}
.stage-crop .stage-n {
  position: absolute; left: 3px; top: 2px;
  font-size: 10px; color: #fff;
  text-shadow: 1px 1px 0 #000;
  font-variant-numeric: tabular-nums;
}

/* 空地：凹槽样式（原版空槽位） */
.stage-crop.empty {
  background-image: none;
  background-color: #6a5a3a;
  border-color: #000;
  box-shadow: inset 2px 2px 0 #3a2f1a, inset -2px -2px 0 #8a7a5a;
  display: grid; place-items: center;
}
.stage-crop.empty:hover { background-color: #7a6a44; }
.stage-crop .empty-mark {
  font-size: 30px;
  font-weight: 300;
  color: rgba(255, 255, 255, .38);
  text-shadow: 2px 2px 0 rgba(0,0,0,.4);
  pointer-events: none;
}

/* 可收角标 */
.stage-badge {
  position: absolute; right: 10px; top: 10px;
  background: #3a7a20;
  color: #fff;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #6aa040;
  padding: 3px 9px;
  font-size: 12px; font-weight: 700;
  text-shadow: 2px 2px 0 #1a1a1a;
  z-index: 3;
  display: none;
}
.stage-badge.show { display: block; }

/* 农场状态行 */
.farm-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 13px;
  background: var(--mc-bg);
  font-size: 12px;
  color: #3f3f3f;
  text-shadow: none;
  border-top: 0;
}
.farm-status .tag {
  background: #2a5a14;
  color: #a8e07a;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #4a8a28;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 11px;
  text-shadow: 1px 1px 0 #1a1a1a;
}
.farm-status .desc { color: #3f3f3f; }
.farm-status .grow {
  margin-left: auto;
  color: #1a4a10;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ── 背包 ── */
.inv-panel { margin-bottom: 12px; }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;
}
.inv-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--mc-slot-bg);
  border: 2px solid var(--mc-border);
  box-shadow:
    inset 2px 2px 0 var(--mc-border-lo),
    inset -2px -2px 0 var(--mc-border-hi),
    0 0 0 2px #000;
  display: grid;
  place-items: center;
}
.inv-item img { width: 28px; height: 28px; image-rendering: pixelated; }
.inv-item .n {
  position: absolute; right: 2px; bottom: 0;
  font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  font-variant-numeric: tabular-nums;
}
.inv-item .nm {
  position: absolute; left: 0; right: 0; bottom: -16px;
  font-size: 10px; color: #c0c0c0; text-align: center;
  text-shadow: 1px 1px 0 #1a1a1a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-empty { color: #5a5a5a; font-size: 12px; text-shadow: none; }

/* ── 六格模块 ── */
.mods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.mod {
  position: relative;
  height: 124px;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.16), inset -2px -2px 0 rgba(0,0,0,.4);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #1a1a1a;
  display: block;
  width: 100%;
  font-family: var(--mc-font);
  transition: none;
}
.mod:hover { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #000; }
.mod:active { transform: translateY(1px); }

.mod-bg { position: absolute; inset: 0; background-size: 48px 48px; image-rendering: pixelated; }
.mod-bg.dark { filter: brightness(.55); }

.mod-icon {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.7));
}
.mod-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px; font-weight: 700;
  text-align: center;
  padding: 5px 0;
  text-shadow: 2px 2px 0 #1a1a1a;
  letter-spacing: .5px;
}

/* ── 赛季卡 ── */
.rank-card { position: sticky; top: 58px; }

.rank-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.rank-tab {
  border: 2px solid #000;
  background: var(--mc-bg-dark);
  color: #fff;
  font-family: var(--mc-font);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  cursor: pointer;
  text-shadow: 1px 1px 0 #3f3f3f;
  box-shadow: inset 1px 1px 0 #a8a8a8, inset -1px -1px 0 #4a4a4a;
}
.rank-tab:hover { background: #a0a0a0; }
.rank-tab.on {
  background: #4a7a34;
  box-shadow: inset 1px 1px 0 #6fa04f, inset -1px -1px 0 #2d4a1f;
}

.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 7px;
  font-size: 11.5px;
  color: #3f3f3f;
  text-shadow: none;
  background: #b8b8b8;
  border: 1px solid #8b8b8b;
}
.rank-row:nth-child(odd) { background: #c0c0c0; }
.rank-row.me {
  background: #d8c060;
  border-color: #a08000;
  font-weight: 700;
}
.rank-row .no {
  width: 16px; text-align: center;
  font-weight: 700;
  color: #5a5a5a;
  font-variant-numeric: tabular-nums;
}
.rank-row:nth-child(1) .no { color: #a07000; }
.rank-row:nth-child(2) .no { color: #6a6a6a; }
.rank-row:nth-child(3) .no { color: #8a5a20; }
.rank-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .vl { color: #1a4a10; font-variant-numeric: tabular-nums; font-weight: 700; }
.rank-row .vl em { font-style: normal; color: #5a5a5a; font-size: 10px; }

/* ── 底部播报：原版聊天栏样式 ── */
.ticker {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .68);
  border-top: 2px solid #000;
  padding: 5px 16px;
  font-size: 11.5px;
  color: #c0c0c0;
  text-shadow: 1px 1px 0 #1a1a1a;
  z-index: 40;
  overflow: hidden;
  white-space: nowrap;
}
.ticker span { display: inline-block; animation: mc-slide 30s linear infinite; }
@keyframes mc-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── 选作物弹层里的按钮 ── */
.crop-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crop-btn {
  border: 2px solid #000;
  background: var(--mc-bg-dark);
  color: #fff;
  font-family: var(--mc-font);
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-shadow: 1px 1px 0 #3f3f3f;
  box-shadow: inset 2px 2px 0 #a8a8a8, inset -2px -2px 0 #4a4a4a;
}
.crop-btn:hover:not(:disabled) { background: #a0a0a0; }
.crop-btn:active:not(:disabled) { transform: translateY(1px); }
.crop-btn b { font-size: 13px; }
.crop-btn small { font-size: 10.5px; color: #d0d0d0; text-shadow: 1px 1px 0 #3f3f3f; }
.crop-btn em { font-size: 10px; color: #b0b0b0; font-style: normal; text-shadow: 1px 1px 0 #3f3f3f; }
.crop-btn.dis, .crop-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 提示条 ── */
.toasts {
  position: fixed; right: 14px; bottom: 44px;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: #212121;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #4a4a4a, inset -2px -2px 0 #101010;
  color: #fff;
  text-shadow: 1px 1px 0 #3f3f3f;
  font-size: 12px;
  padding: 6px 12px;
  max-width: 300px;
  font-family: var(--mc-font);
}
.toast.gold { color: var(--mc-gold); }
.toast.err  { color: var(--mc-red); }

/* ── 锁定遮罩 ── */
#lockWrap {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  z-index: 250; padding: 20px;
}
#lockWrap[hidden] { display: none; }
.lock-card {
  background: var(--mc-bg);
  border: 2px solid var(--mc-border);
  box-shadow:
    inset 2px 2px 0 var(--mc-border-hi),
    inset -2px -2px 0 var(--mc-border-lo),
    0 0 0 2px #000;
  padding: 22px 26px;
  max-width: 420px; width: 100%;
  text-align: center;
  color: var(--mc-ink);
  font-family: var(--mc-font);
}
.lock-card h2 { font-size: 16px; margin-bottom: 8px; color: var(--mc-ink); text-shadow: none; }
.lock-card p { font-size: 12.5px; color: #4a4a4a; margin-bottom: 16px; line-height: 1.75; text-shadow: none; }

/* ── 响应式 ── */
@media (max-width: 1200px) {
  .shell { grid-template-columns: 1fr; }
  .rank-card { position: static; }
}
@media (max-width: 860px) {
  .mods { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar .right { margin-left: 0; }
}
@media (max-width: 560px) {
  html, body { overflow-x: hidden; }
  body { font-size: 12.5px; }
  .shell { padding: 10px 10px 0; gap: 10px; }
  .mods { gap: 7px; }
  .mod { height: 104px; }
  .mod-name { font-size: 12px; padding: 4px 0; }
  .mod-icon { width: 44px; height: 44px; }
  .farm-stage { min-height: 150px; gap: 7px; padding: 18px 10px 26px; }
  .stage-crop { width: 66px; height: 66px; background-size: 66px 66px; }
  .stage-crop > img.crop { width: 56px; height: 56px; bottom: 8px; }
  .champ { padding: 5px; }
  .champ-title { font-size: 10.5px; padding: 0 6px 0 2px; }
  .champ-item { padding: 3px 6px 3px 4px; }
  .champ-item .t b { font-size: 10px; }
  .champ-item .t small { font-size: 9px; }
  .topbar { padding: 7px 9px; }
  .face { width: 30px; height: 30px; flex-basis: 30px; }
  .who .n { font-size: 12.5px; }
  .stat-block { padding: 3px 8px; }
  .stat-block b { font-size: 12px; }
  .ticker { font-size: 10.5px; padding: 5px 10px; }
  .toasts { right: 9px; left: 9px; }
  .toast { max-width: none; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .inv-item img { width: 24px; height: 24px; }
  .crop-pick { grid-template-columns: 1fr; }
}
