/* ==========================================================
   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: 560px;
  display: flex;
  align-items: center;
  padding: 60px 4vw;
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(120,167,255,.25), transparent 60%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 100%);
  overflow: hidden;
}
.hero::before {
  /* 底部草地 */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background:
    repeating-linear-gradient(90deg, #3c8527 0 32px, #44952c 32px 64px) top/100% 30px no-repeat,
    repeating-linear-gradient(90deg, #866043 0 32px, #7a563c 32px 64px) bottom/100% 60px no-repeat;
  border-top: 3px solid #000;
  image-rendering: pixelated;
}
.hero::after {
  /* 像素云 */
  content: "";
  position: absolute;
  top: 40px; right: 8%;
  width: 220px; height: 60px;
  background: rgba(255,255,255,.08);
  box-shadow: 30px -20px 0 rgba(255,255,255,.06), -60px 30px 0 rgba(255,255,255,.05);
  image-rendering: pixelated;
}

.hero-inner { position: relative; z-index: 2; max-width: 640px; }

.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-shadow: 3px 3px 0 #000, 6px 6px 0 rgba(0,0,0,.35);
}
.hero h1 .green { color: var(--grass-light); }
.hero p.sub {
  margin-top: 18px;
  font-size: 17px;
  color: var(--text-dim);
  max-width: 520px;
}
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

/* 旋转的草方块 */
.cube-wrap {
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  perspective: 900px;
  z-index: 1;
}
.cube {
  width: 140px; height: 140px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 14s linear infinite;
}
.cube .face {
  position: absolute;
  width: 140px; height: 140px;
  border: 3px solid #000;
  image-rendering: pixelated;
}
.face.top    { background: repeating-conic-gradient(#5ebB2b 0 25%, #4c9d22 0 50%) 0 0/40px 40px; transform: rotateX(90deg) translateZ(70px); }
.face.bottom { background: #5d4430; transform: rotateX(-90deg) translateZ(70px); }
.face.front  { background: linear-gradient(#5ebB2b 0 34%, #3c8527 34% 40%, #866043 40% 100%); transform: translateZ(70px); }
.face.back   { background: linear-gradient(#5ebB2b 0 34%, #3c8527 34% 40%, #7a563c 40% 100%); transform: rotateY(180deg) translateZ(70px); }
.face.left   { background: linear-gradient(#5ebB2b 0 34%, #3c8527 34% 40%, #866043 40% 100%); transform: rotateY(-90deg) translateZ(70px); }
.face.right  { background: linear-gradient(#5ebB2b 0 34%, #3c8527 34% 40%, #7a563c 40% 100%); transform: rotateY(90deg) translateZ(70px); }
@keyframes spin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to   { transform: rotateX(-18deg) rotateY(360deg); }
}

/* ---------- 通用区块 ---------- */
.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) {
  .cube-wrap { display: none; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { min-height: 480px; }
}
