/* ==========================================================
   mytiandog.com — Minecraft 官网风格
   设计语言：方块像素 / 草绿 #3C8527 / 泥土棕 / 石灰 / 深夜空
   中文字体：MiSans（参考 superlinear.academy 的现代无衬线风格）
   ========================================================== */

/* MiSans 网络字体（jsdelivr 按需分包加载，只下载页面用到的字） */
@import url("https://cdn.jsdelivr.net/npm/misans@4.1.0/lib/Normal/MiSans-Regular.min.css");
@import url("https://cdn.jsdelivr.net/npm/misans@4.1.0/lib/Normal/MiSans-Medium.min.css");
@import url("https://cdn.jsdelivr.net/npm/misans@4.1.0/lib/Normal/MiSans-Semibold.min.css");
@import url("https://cdn.jsdelivr.net/npm/misans@4.1.0/lib/Normal/MiSans-Bold.min.css");

:root {
  --grass: #3c8527;
  --grass-light: #5ebB2b;
  --grass-dark: #2a5d1c;
  --dirt: #866043;
  --dirt-dark: #5d4430;
  --stone: #7f7f7f;
  --night: #15151e;
  --night-2: #1e1e2a;
  --night-3: #262634;
  --sky: #78a7ff;
  --diamond: #4aedd9;
  --gold: #fcdb05;
  --text: #f2f2f2;
  --text-dim: #a8a8b8;
  --font: "MiSans", "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--night);
  color: var(--text);
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .th { font-weight: 700; letter-spacing: 0.01em; }

/* ---------- 像素化工具 ---------- */
.pixel-corners {
  /* 用多重 box-shadow 模拟像素圆角（阶梯直角） */
  border: 4px solid transparent;
  image-rendering: pixelated;
}

.pixel-frame {
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.25),
    inset -2px -2px 0 rgba(0,0,0,.35);
}

.btn-mc {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  color: #fff;
  text-decoration: none;
  background: var(--grass);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -4px 0 rgba(0,0,0,.4);
  padding: 12px 28px;
  cursor: pointer;
  transition: background .12s, transform .12s;
  user-select: none;
}
.btn-mc:hover { background: var(--grass-light); }
.btn-mc:active { transform: translateY(2px); box-shadow: inset -2px -2px 0 rgba(255,255,255,.2), inset 2px 4px 0 rgba(0,0,0,.4); }

.btn-mc.secondary { background: var(--stone); }
.btn-mc.secondary:hover { background: #9a9a9a; }

.btn-mc.gold { background: #b8860b; }
.btn-mc.gold:hover { background: var(--gold); color: #222; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 4vw;
  height: 64px;
  background: rgba(21,21,30,.96);
  border-bottom: 3px solid #000;
  box-shadow: 0 2px 0 rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 2px;
  height: 100%;
  overflow: hidden;
}
.logo-img {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px;
  max-height: 30px;
  object-fit: contain;
  object-position: center 28%;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.55));
}
.logo em { color: var(--grass-light); font-style: normal; }

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 14px;
  border: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: var(--night-3); border-color: #000; box-shadow: inset 0 2px 0 rgba(255,255,255,.1); }

.nav-cta { margin-left: 8px; padding: 8px 18px !important; font-size: 14px !important; }

/* ---------- 英雄区（横幅轮播） ---------- */
.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #0d0d14;
  border-bottom: 3px solid #000;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .7s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero::after {
  /* 底部渐暗，保证文案可读 */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,8,14,.85) 0%, rgba(8,8,14,.45) 42%, rgba(8,8,14,0) 65%),
              linear-gradient(0deg, rgba(8,8,14,.8) 0%, rgba(8,8,14,0) 40%);
  pointer-events: none;
}

.hero-caption {
  position: absolute;
  left: 4vw;
  bottom: 88px;
  z-index: 3;
  max-width: 560px;
  padding: 24px 28px 26px;
  background: rgba(8, 8, 14, .82);
  border-left: 4px solid var(--grass);
  box-shadow: 0 6px 0 rgba(0,0,0,.45);
}
.hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: var(--grass);
  padding: 3px 10px;
  margin-bottom: 12px;
}
.hero-caption h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-shadow: 3px 3px 0 rgba(0,0,0,.8);
}
.hero-desc {
  margin-top: 10px;
  font-size: 15px;
  color: #d2d2dc;
  max-width: 480px;
}
.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero-thumbs {
  position: absolute;
  right: 4vw;
  bottom: 88px;
  z-index: 3;
  display: flex;
  gap: 10px;
}
.hero-thumb {
  position: relative;
  width: 104px;
  height: 66px;
  padding: 0;
  border: 2px solid #000;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  opacity: .68;
  transition: opacity .2s, transform .2s, box-shadow .2s;
  image-rendering: pixelated;
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-thumb:hover { opacity: 1; transform: translateY(-4px); }
.hero-thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--grass-light);
}
.thumb-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(0,0,0,.7);
  padding: 2px 0;
  text-align: center;
}

.hero-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5px;
  background: rgba(255,255,255,.12);
  z-index: 4;
}
.hero-progress-bar {
  height: 100%;
  width: 0;
  background: var(--grass-light);
  transition: width .2s linear;
}

/* 旧版元素保留但不再使用 */
.hero-inner { display: none; }


.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }


/* ---------- 通用区块 ---------- */
.section { padding: 72px 4vw; }
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.section-title::before {
  content: "";
  width: 22px; height: 22px;
  background: var(--grass);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.35);
}
.section-sub { color: var(--text-dim); margin-bottom: 34px; }

/* ---------- 游戏卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  background: var(--night-2);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.08), 0 6px 0 rgba(0,0,0,.45);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  display: block;
  overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.08), 0 12px 0 rgba(0,0,0,.45); }
.card:hover .card-thumb .overlay { opacity: 1; }

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid #000;
  image-rendering: pixelated;
}
.card-thumb .overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.overlay .play-btn {
  width: 64px; height: 64px;
  background: var(--grass);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -4px 0 rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.overlay .play-btn::after {
  content: "";
  border-left: 20px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 5px;
}
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.card-desc { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.card-tag {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px;
  background: var(--gold); color: #222;
  border: 2px solid #000;
  padding: 2px 8px;
}
.card-tag.dev { background: var(--diamond); }

/* ---------- 特性区 ---------- */
.features {
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  border-top: 3px solid #000;
}
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature {
  background: var(--night-3);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07);
  padding: 24px;
}
.feature .icon {
  width: 46px; height: 46px;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), inset -2px -2px 0 rgba(0,0,0,.3);
  margin-bottom: 14px;
}
.feature h3 { font-size: 17px; letter-spacing: 1px; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--text-dim); }
.icon.f-save { background: var(--diamond); }
.icon.f-user { background: var(--grass-light); }
.icon.f-free { background: var(--gold); }

/* ---------- 公告条 ---------- */
.notice-strip {
  margin: 0 4vw 60px;
  padding: 14px 20px;
  background: rgba(60,133,39,.15);
  border: 2px dashed var(--grass);
  color: var(--text-dim);
  font-size: 14px;
}
.notice-strip b { color: var(--grass-light); }

/* ---------- 页脚 ---------- */
footer {
  background: #0d0d14;
  border-top: 3px solid #000;
  padding: 34px 4vw;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 13px;
}
footer .foot-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
footer .mini-block { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }

/* ---------- 游戏页 ---------- */
.game-nav { height: 56px; }
.game-shell { max-width: 1200px; margin: 0 auto; padding: 24px 4vw 60px; }
.game-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.game-head h1 { font-size: 26px; letter-spacing: 0.02em; text-shadow: 2px 2px 0 #000; }
.game-head .back { margin-left: auto; }

.game-frame-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg, #1a1a26 0 24px, #17171f 24px 48px);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 8px 0 rgba(0,0,0,.5);
  overflow: hidden;
}
.game-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.game-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  color: var(--text-dim);
}
.game-placeholder .cube-mini {
  width: 54px; height: 54px;
  background: linear-gradient(#5ebB2b 0 34%, #3c8527 34% 40%, #866043 40% 100%);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.3);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.game-meta { display: flex; gap: 18px; align-items: center; margin-top: 16px; color: var(--text-dim); font-size: 14px; flex-wrap: wrap; }
.save-dot { width: 10px; height: 10px; background: var(--grass-light); border: 2px solid #000; display: inline-block; }

/* ---------- 登录弹窗 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(8, 8, 14, .78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 380px;
  background: var(--night-2);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.08), 0 10px 0 rgba(0,0,0,.5);
  padding: 28px 26px 24px;
  position: relative;
}
.modal-title { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; color: var(--text-dim);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #fff; }
.input {
  width: 100%;
  background: var(--night-3);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.35);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 12px;
  margin-bottom: 12px;
  outline: none;
}
.input:focus { box-shadow: inset 2px 2px 0 rgba(0,0,0,.35), 0 0 0 2px var(--grass); }
.modal-msg { color: #ff8a7a; font-size: 13px; min-height: 20px; margin-bottom: 10px; }
.modal-switch { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 14px; }
.modal-switch a { color: var(--grass-light); text-decoration: none; }
.modal-switch a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { min-height: 520px; }
  .hero-caption {
    left: 0; right: 0; bottom: 96px;
    max-width: none;
    border-left: none;
    border-top: 3px solid var(--grass);
    padding: 18px 20px 20px;
  }
  .hero-thumbs {
    left: 0; right: 0; bottom: 28px;
    justify-content: center;
    gap: 6px;
  }
  .hero-thumb { width: 76px; height: 48px; }
  .thumb-label { display: none; }
}
