/* ============================================
   MC未来学院 — Minecraft 主题增强样式
   包含：像素字体、经验条、成就弹窗、红石按钮、
   方块纹理、附魔效果、BossBar、过渡动画
   ============================================ */

/* ---- 1. MC 像素字体 ---- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

.mc-pixel-font {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* 像素按钮 */
.mc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: 2px solid rgba(92,255,109,0.3);
  border-radius: 4px;
  background: linear-gradient(180deg, #7B7B7B 0%, #4B4B4B 100%);
  color: #F0F0F0;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.65rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #2B2B2B;
  transform: translateY(0);
  transition: all 0.08s linear;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
}
.mc-btn:active {
  box-shadow: 0 1px 0 #2B2B2B;
  transform: translateY(3px);
}
.mc-btn:hover {
  border-color: rgba(92,255,109,0.6);
  background: linear-gradient(180deg, #8B8B8B 0%, #5B5B5B 100%);
}

/* ---- 2. 绿宝石经验条 / XP Bar ---- */
@keyframes xpBarShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.xp-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
}
.xp-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #2D7D2D, #5CFF6D, #2D7D2D);
  background-size: 200% 100%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: xpBarShimmer 2s linear infinite;
  position: relative;
}
.xp-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35));
  border-radius: 0 4px 4px 0;
}
.xp-bar-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  font-family: 'Courier New', monospace;
}

/* XP Bar for page loading (fixed top) */
.xp-bar-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 4px;
}
.xp-bar-loading .xp-bar-fill {
  height: 4px;
  border-radius: 0;
  width: 0%;
  animation: xpBarLoading 2s ease-in-out forwards;
}
@keyframes xpBarLoading {
  0% { width: 0%; }
  30% { width: 30%; }
  60% { width: 65%; }
  85% { width: 85%; }
  100% { width: 100%; }
}

/* ---- 3. 红石发光按钮 ---- */
@keyframes redstonePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,0,0,0.3); }
  50% { box-shadow: 0 0 20px rgba(255,0,0,0.7); }
}
@keyframes redstoneGlow {
  0%, 100% { text-shadow: 0 0 4px rgba(255,68,68,0.4); }
  50% { text-shadow: 0 0 12px rgba(255,68,68,0.9); }
}

.btn-redstone {
  background: linear-gradient(135deg, #8B0000, #CC0000) !important;
  border-color: rgba(255,68,68,0.3) !important;
  color: #FFAAAA !important;
  animation: redstonePulse 2s ease-in-out infinite;
}
.btn-redstone:hover {
  border-color: rgba(255,68,68,0.7) !important;
  color: #FFDDDD !important;
  box-shadow: 0 0 30px rgba(255,0,0,0.5) !important;
}

/* 萤石悬停发光 */
.btn-glowstone {
  transition: all 0.3s !important;
}
.btn-glowstone:hover {
  box-shadow: 0 0 25px rgba(255,255,150,0.4), inset 0 0 15px rgba(255,255,150,0.08) !important;
  border-color: rgba(255,255,150,0.4) !important;
}

/* ---- 4. MC 成就弹窗 ---- */
@keyframes achievementSlideIn {
  0% { transform: translateX(120%) scale(0.8); opacity: 0; }
  12% { transform: translateX(-5%) scale(1.05); opacity: 1; }
  18% { transform: translateX(0) scale(1); }
  82% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(120%) scale(0.9); }
}
@keyframes achievementIconPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.15); filter: brightness(1.3); }
}
@keyframes achievementSparkle {
  0% { transform: rotate(0deg) scale(0); opacity: 0; }
  50% { transform: rotate(180deg) scale(1); opacity: 1; }
  100% { transform: rotate(360deg) scale(0); opacity: 0; }
}

.mc-achievement {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 16px 18px;
  background: linear-gradient(135deg, rgba(30,30,30,0.97), rgba(20,20,30,0.97));
  border: 2px solid rgba(92,255,109,0.2);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7), inset 0 0 30px rgba(92,255,109,0.03);
  animation: achievementSlideIn 4.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
  max-width: 380px;
  backdrop-filter: blur(12px);
}
.mc-achievement-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  animation: achievementIconPulse 1.5s ease-in-out infinite;
  position: relative;
}
.mc-achievement-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92,255,109,0.15), transparent 70%);
  animation: achievementSparkle 3s linear infinite;
}
.mc-achievement-body {
  flex: 1;
  min-width: 0;
}
.mc-achievement-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.55rem;
  color: #FFD700;
  margin-bottom: 3px;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
}
.mc-achievement-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-achievement-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.mc-achievement-close {
  position: absolute;
  right: 6px;
  top: 6px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  pointer-events: auto;
}

/* ---- 5. 方块纹理背景 (CSS-only, no images) ---- */
.bg-dirt {
  background-image:
    linear-gradient(45deg, rgba(139,90,43,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(139,90,43,0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(139,90,43,0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(139,90,43,0.04) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.bg-stone {
  background-image:
    linear-gradient(45deg, rgba(125,125,125,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(125,125,125,0.04) 25%, transparent 25%);
  background-size: 16px 16px;
}
.bg-grass {
  background-image:
    linear-gradient(0deg, rgba(91,140,41,0.06) 4px, transparent 4px),
    linear-gradient(90deg, rgba(139,90,43,0.04) 25%, transparent 25%);
  background-size: 100% 16px, 20px 20px;
}

/* ---- 6. 附魔台符文动画 ---- */
@keyframes enchantRune {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  20% { opacity: 0.7; }
  80% { opacity: 0.7; }
  100% { transform: translateY(-30px) rotate(360deg); opacity: 0; }
}
@keyframes enchantTableGlow {
  0%, 100% { filter: hue-rotate(0deg) brightness(1); }
  50% { filter: hue-rotate(30deg) brightness(1.2); }
}

.enchant-glow {
  animation: enchantTableGlow 3s ease-in-out infinite;
}
.enchant-runes {
  position: relative;
  overflow: hidden;
}
.enchant-rune {
  position: absolute;
  font-size: 0.7rem;
  color: rgba(92,255,109,0.3);
  animation: enchantRune 2.5s ease-out infinite;
  pointer-events: none;
}
.enchant-rune:nth-child(1) { left: 10%; animation-delay: 0s; }
.enchant-rune:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.enchant-rune:nth-child(3) { left: 50%; animation-delay: 1s; }
.enchant-rune:nth-child(4) { left: 70%; animation-delay: 1.5s; }
.enchant-rune:nth-child(5) { left: 85%; animation-delay: 2s; }

/* ---- 7. BossBar 加载进度条 ---- */
@keyframes bossBarDamage {
  0%, 100% { background: linear-gradient(90deg, #FF4444, #FF8888); }
  50% { background: linear-gradient(90deg, #FF2222, #FF6666); }
}
@keyframes bossBarHealth {
  0% { width: 100%; }
  100% { width: 0%; }
}

.bossbar-container {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  width: 90%;
  max-width: 600px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.7);
  border: 2px solid rgba(80,80,80,0.5);
  border-radius: 6px;
  display: none;
  backdrop-filter: blur(8px);
}
.bossbar-label {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.5rem;
  color: #FFF;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.bossbar-bg {
  height: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.4);
  position: relative;
}
.bossbar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #CC4444, #FF6666, #CC4444);
  background-size: 200% 100%;
  animation: bossBarDamage 2s ease-in-out infinite;
  transition: width 0.3s;
}
.bossbar-fill.ender {
  background: linear-gradient(90deg, #8800AA, #CC44FF, #8800AA);
  background-size: 200% 100%;
  box-shadow: 0 0 15px rgba(136,0,170,0.5);
}

/* ---- 8. 页面过渡动画 ---- */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.page-enter {
  animation: pageFadeIn 0.4s ease-out forwards;
}
.page-enter-slide {
  animation: pageSlideIn 0.35s ease-out forwards;
}

/* Cross-document view transition */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: 0.25s ease-out both fadeOut;
}
::view-transition-new(root) {
  animation: 0.35s ease-out 0.1s both pageFadeIn;
}
@keyframes fadeOut {
  to { opacity: 0; transform: scale(0.98); }
}

/* ---- 9. MC 物品栏弹窗 ---- */
.mc-inventory {
  background: linear-gradient(135deg, rgba(30,30,30,0.98), rgba(20,20,30,0.98));
  border: 3px solid #4B4B4B;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6), inset 0 0 0 1px #6B6B6B;
  padding: 16px;
}
.mc-inventory-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.55rem;
  color: #F0F0F0;
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4B4B4B;
}
.mc-inventory-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  background: #4B4B4B;
  padding: 2px;
  border-radius: 2px;
}
.mc-inventory-slot {
  aspect-ratio: 1;
  background: #8B8B8B;
  border: 2px solid;
  border-color: #6B6B6B #4B4B4B #4B4B4B #6B6B6B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.15s;
}
.mc-inventory-slot:hover {
  background: #9B9B9B;
  border-color: #7B7B7B #5B5B5B #5B5B5B #7B7B7B;
}

/* ---- 10. 计分板侧栏 ---- */
.mc-scoreboard {
  background: rgba(0,0,0,0.7);
  border: 2px solid #4B4B4B;
  border-radius: 4px;
  overflow: hidden;
  min-width: 140px;
}
.mc-scoreboard-header {
  background: linear-gradient(180deg, #0044BB, #0033AA);
  color: #FFF;
  padding: 4px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
  border-bottom: 2px solid #4B4B4B;
}
.mc-scoreboard-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mc-scoreboard-row:last-child { border-bottom: none; }
.mc-scoreboard-row .label { color: rgba(255,255,255,0.7); }
.mc-scoreboard-row .value { color: #FFD700; font-weight: bold; }

/* ---- 11. 绿宝石/金币脉冲动画 ---- */
@keyframes emeraldPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(92,255,109,0.3)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(92,255,109,0.6)); }
}
.emer-pulse {
  animation: emeraldPulse 1.2s ease-in-out infinite;
  display: inline-block;
}

/* ---- 12. 通用卡片 MC 风格 ---- */
.mc-card {
  background: linear-gradient(145deg, #1e1e32, #16162a);
  border: 1px solid rgba(92,255,109,0.08);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.mc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(92,255,109,0.15), transparent);
}
.mc-card:hover {
  border-color: rgba(92,255,109,0.15);
}
.mc-card:hover::before {
  background: linear-gradient(90deg, transparent, rgba(92,255,109,0.4), transparent);
}

/* ---- 13. 加载骨架屏 MC 风格 ---- */
@keyframes mcSkeletonPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
.mc-skeleton {
  background: linear-gradient(90deg, rgba(92,255,109,0.04) 25%, rgba(92,255,109,0.08) 50%, rgba(92,255,109,0.04) 75%);
  background-size: 200% 100%;
  animation: mcSkeletonPulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ---- 14. 鞘翅飞行尾部效果 (页面滚动) ---- */
@keyframes elytraTrail {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(0) translateY(-20px); }
}
.elytra-particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(200,180,255,0.6), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: elytraTrail 0.8s ease-out forwards;
  z-index: 9999;
}

/* ---- 15. 统一 Toast 通知（MC 成就风格回退） ---- */
.mc-toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.mc-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(30,30,30,0.96), rgba(20,20,30,0.96));
  border: 1px solid rgba(92,255,109,0.15);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
  max-width: 340px;
  backdrop-filter: blur(10px);
}
@keyframes toastIn {
  from { transform: translateX(100%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(100%) scale(0.9); opacity: 0; }
}
.mc-toast.out {
  animation: toastOut 0.3s ease-in forwards;
}
.mc-toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.mc-toast-icon.success { color: #5CFF6D; }
.mc-toast-icon.error { color: #FF4444; }
.mc-toast-icon.info { color: #44AAFF; }
.mc-toast-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
}

/* ---- 16. 移动端优化 ---- */
@media (max-width: 768px) {
  .mc-achievement {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 12px 16px;
  }
  .mc-achievement-title {
    font-size: 0.45rem;
  }
  .mc-achievement-text {
    font-size: 0.78rem;
    white-space: normal;
  }
  .bossbar-container {
    width: 95%;
  }
  .mc-inventory-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* ---- 17. Homepage Hero Styles ---- */
.mc-hero-title { font-size: 2.6rem; font-weight: 900; color: #fff; text-shadow: 0 0 30px rgba(92,255,109,0.3); margin-bottom: 8px; }
.mc-hero-title .highlight { color: #5CFF6D; }
.mc-hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.8); margin-bottom: 6px; font-weight: 300; }
.mc-hero-desc { font-size: 0.95rem; color: rgba(255,255,255,0.55); max-width: 700px; margin: 12px auto 20px; line-height: 1.7; }
.mc-hero-btn { display:inline-flex; align-items:center; gap:8px; padding:12px 30px; background:linear-gradient(135deg,#5CFF6D,#3DDD4E); color:#0a0a14; border-radius:30px; font-weight:700; font-size:1rem; text-decoration:none; transition:all .25s; margin:4px 6px; }
.mc-hero-btn:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(92,255,109,0.3); color:#0a0a14; text-decoration:none; }
.mc-hero-btn-outline { display:inline-flex; align-items:center; gap:8px; padding:12px 28px; background:rgba(255,255,255,0.06); color:#fff; border-radius:30px; font-weight:600; font-size:0.95rem; text-decoration:none; border:1px solid rgba(255,255,255,0.12); transition:all .25s; margin:4px 6px; }
.mc-hero-btn-outline:hover { background:rgba(255,255,255,0.12); color:#fff; text-decoration:none; }
.mc-badge { display:inline-block; padding:4px 14px; border-radius:20px; font-size:0.75rem; font-weight:700; letter-spacing:1px; margin-bottom:14px; }
.mc-badge-green { background:rgba(92,255,109,0.15); color:#5CFF6D; border:1px solid rgba(92,255,109,0.2); }
.mc-section-title { font-size:1.8rem; font-weight:800; color:#fff; margin:0 0 8px; }
.mc-section-title .highlight { color:#5CFF6D; }
.mc-section-sub { color:var(--text-secondary); font-size:0.95rem; margin-bottom:30px; }
.mc-feature-card { background:rgba(30,30,55,0.6); border:1px solid var(--border); border-radius:14px; padding:28px 22px; text-align:center; transition:all 0.3s; height:100%; }
.mc-feature-card:hover { border-color:rgba(92,255,109,0.2); transform:translateY(-3px); box-shadow:0 8px 30px rgba(0,0,0,0.2); }
.mc-feature-icon { width:56px;height:56px;border-radius:14px;display:flex;align-items:center;justify-content:center;margin:0 auto 14px;font-size:1.5rem; }
.mc-feature-card h4 { font-size:1rem;font-weight:700;color:#fff;margin:0 0 8px; }
.mc-feature-card p { font-size:0.85rem;color:var(--text-secondary);margin:0;line-height:1.6; }
.mc-about-card { background:rgba(30,30,55,0.6); border:1px solid var(--border); border-radius:14px; padding:24px; height:100%; transition:all 0.3s; }
.mc-about-card:hover { border-color:rgba(92,255,109,0.2); }
.mc-about-card h4 { font-size:1.05rem;font-weight:700;color:#fff;margin:0 0 10px; }
.mc-about-card p { font-size:0.85rem;color:var(--text-secondary);line-height:1.7;margin:0; }
.mc-about-card .check-item { display:flex;gap:8px;align-items:flex-start;margin:6px 0;font-size:0.85rem;color:var(--text-secondary); }
.mc-about-card .check-item i { color:#5CFF6D; margin-top:3px; flex-shrink:0; }
.mc-stat { text-align:center; padding:20px; }
.mc-stat-icon { font-size:2rem; color:#5CFF6D; margin-bottom:8px; }
.mc-stat-num { font-size:2rem; font-weight:800; color:#fff; }
.mc-stat-label { font-size:0.85rem; color:var(--text-secondary); margin-top:4px; }
@media (max-width:768px) {
  .mc-hero-title { font-size:1.6rem; }
  .mc-hero-sub { font-size:0.95rem; }
  .mc-section-title { font-size:1.3rem; }
}

/* ---- 18. 预留 ---- */
