/* ============================================================
   mc-ui.css — MC 像素风组件库
   像素按钮（石质/绿色，点击下凹反馈）、像素弹窗、
   MC 绿色经验条（Experience Bar）上传进度组件
   ============================================================ */

/* ---------------- 像素 SVG 图标 ---------------- */
.mc-icon {
  display: inline-block;
  vertical-align: -0.18em;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.mc-btn .mc-icon { margin-right: 2px; }
.mc-sidebar__item .mc-icon { margin-right: 8px; vertical-align: -0.22em; }
.mc-logo .mc-icon { vertical-align: -0.15em; margin-right: 6px; }
.mc-tab .mc-icon { margin-right: 4px; }

/* ---------------- 像素按钮 ---------------- */
.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.55);
  padding: 12px 22px;
  cursor: pointer;
  user-select: none;
  border: 3px solid var(--border-dark);
  background: var(--mc-stone-lt);
  box-shadow:
    inset 3px 3px 0 rgba(255,255,255,0.55),
    inset -3px -3px 0 rgba(0,0,0,0.35);
  transition: transform 0.02s;
  image-rendering: pixelated;
}
.mc-btn:hover { filter: brightness(1.12); }
/* 点击下凹反馈 */
.mc-btn:active {
  box-shadow:
    inset -3px -3px 0 rgba(255,255,255,0.35),
    inset 3px 3px 0 rgba(0,0,0,0.4);
  transform: translate(1px, 1px);
}
.mc-btn:disabled {
  filter: grayscale(0.7) brightness(0.8);
  cursor: not-allowed;
}

/* 石质按钮（默认灰）*/
.mc-btn--stone { background: var(--mc-stone-lt); }
/* 绿色主行动按钮 */
.mc-btn--grass {
  background: var(--mc-grass-lt);
  box-shadow:
    inset 3px 3px 0 rgba(255,255,255,0.4),
    inset -3px -3px 0 var(--mc-grass-dk);
}
/* 红石危险按钮 */
.mc-btn--red { background: var(--mc-red); }
/* 橡木按钮 */
.mc-btn--oak { background: var(--mc-oak); }
.mc-btn--sm { padding: 6px 12px; font-size: 12px; }
.mc-btn--lg { padding: 16px 30px; font-size: 18px; }

/* ---------------- 像素输入框 ---------------- */
.mc-input {
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  padding: 12px 14px;
  color: #fff;
  background: #2b2b2b;
  border: 3px solid var(--border-dark);
  box-shadow:
    inset 2px 2px 0 #000,
    inset -2px -2px 0 #555;
  outline: none;
}
.mc-input::placeholder { color: #888; }
.mc-input:focus { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--mc-grass); }

.mc-label { display:block; font-size: 13px; color:#333; margin-bottom:6px; font-weight:bold; }

select.mc-input { cursor: pointer; }
textarea.mc-input { resize: vertical; min-height: 90px; }

/* ---------------- 像素弹窗 ---------------- */
.mc-modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mc-modal {
  background: var(--mc-panel);
  border: 5px solid var(--border-dark);
  box-shadow: inset 4px 4px 0 var(--mc-panel-lt), inset -4px -4px 0 var(--mc-panel-dk);
  min-width: 320px; max-width: 92vw; max-height: 88vh; overflow: auto;
  color: var(--mc-text-dark);
}
.mc-modal__title {
  background: var(--mc-grass);
  color: #fff; text-shadow: 2px 2px 0 var(--mc-grass-dk);
  padding: 14px 18px; font-size: 18px; font-weight: bold;
  border-bottom: 4px solid var(--border-dark);
  display: flex; justify-content: space-between; align-items: center;
}
.mc-modal__close { cursor: pointer; color:#fff; font-size: 20px; }
.mc-modal__body { padding: 20px; }
.mc-modal__footer { padding: 0 20px 20px; display:flex; gap:10px; justify-content:flex-end; }

/* ---------------- MC 绿色经验条（Experience Bar） ---------------- */
.mc-exp-wrap { width: 100%; }
.mc-exp-level {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  color: var(--mc-exp);
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #2a5a00;
  margin-bottom: 4px;
  font-family: "Courier New", monospace;
}
.mc-exp-bar {
  position: relative;
  height: 20px;
  background: #000;
  border: 2px solid #1a1a1a;
  /* 像素格纹底 */
  background-image: repeating-linear-gradient(
    90deg, #101010 0, #101010 6px, #1c1c1c 6px, #1c1c1c 8px
  );
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.08);
}
.mc-exp-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--mc-exp);
  /* 经验条像素格纹 */
  background-image: repeating-linear-gradient(
    90deg,
    var(--mc-exp) 0, var(--mc-exp) 6px,
    var(--mc-exp-dk) 6px, var(--mc-exp-dk) 8px
  );
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.45), inset 0 -3px 0 rgba(0,60,0,0.5);
  transition: width 0.25s steps(12);
}
.mc-exp-percent {
  text-align: center;
  font-size: 13px;
  color: #ddd;
  margin-top: 4px;
  text-shadow: 1px 1px 0 #000;
}

/* ---------------- 熔炉烧炼进度条（备选风格） ---------------- */
.mc-furnace-bar {
  position: relative; height: 22px; width: 100%;
  background: #2b2b2b; border: 3px solid var(--border-dark);
  overflow: hidden;
}
.mc-furnace-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff9800, #ffc107);
  background-image: repeating-linear-gradient(90deg,#ff9800 0,#ff9800 5px,#ffb300 5px,#ffb300 8px);
  transition: width 0.2s steps(10);
}

/* ---------------- 徽章 / 标签 ---------------- */
.mc-badge {
  display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: bold;
  color: #fff; border: 2px solid var(--border-dark); text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
.mc-badge--pending { background: #e0a800; }
.mc-badge--ok      { background: var(--mc-grass); }
.mc-badge--reject  { background: var(--mc-red); }
.mc-badge--off     { background: #666; }
.mc-badge--top     { background: var(--mc-redstone); }

/* ---------------- Toast 提示 ---------------- */
.mc-toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.mc-toast {
  background: #2b2b2b; color: #fff; padding: 10px 20px;
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 #555, inset -2px -2px 0 #000;
  font-size: 14px; text-shadow: 1px 1px 0 #000;
  animation: toastIn 0.2s;
}
.mc-toast--ok  { border-left: 6px solid var(--mc-grass); }
.mc-toast--err { border-left: 6px solid var(--mc-red); }
@keyframes toastIn { from { transform: translateY(-20px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* ---------------- 红石中继器开关（后台开关动效） ---------------- */
.mc-switch {
  display: inline-block; width: 54px; height: 26px; position: relative; cursor: pointer;
  background: #2b2b2b; border: 3px solid var(--border-dark);
}
.mc-switch__knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 16px;
  background: #888; transition: left 0.12s steps(3), background 0.12s;
}
.mc-switch--on { background: #3a1010; }
.mc-switch--on .mc-switch__knob { left: 30px; background: var(--mc-redstone); box-shadow: 0 0 8px var(--mc-redstone); }
