/* ================= 学生测验平台 · 我的世界主题 ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --grass: #4c8c2b;        /* 草方块绿 */
  --grass-lt: #6fbf3f;
  --grass-dk: #2f5d1a;
  --xp: #80c71f;           /* 经验条绿 */
  --ink: #141414;          /* 描边黑 */
  --panel: #fdfcf3;        /* 面板米白 */
  --panel-dk: #efe9d2;
  --mc-yellow: #ffff54;    /* MC 标语黄 */
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background:
    linear-gradient(rgba(14, 24, 9, 0.42), rgba(14, 24, 9, 0.42)),
    url("/bg.jpg") center / cover fixed no-repeat;
  min-height: 100vh;
  color: #2b2b1f;
}

.container { max-width: 920px; margin: 0 auto; padding: 28px 16px 60px; }

.hidden { display: none !important; }
.center { text-align: center; }
.accent { color: var(--grass); }

/* 面板：厚描边 + 方块投影 */
.card {
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.38), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  padding: 32px;
}

h1 { font-size: 26px; color: var(--grass-dk); letter-spacing: 1px; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12); }
h2 { font-size: 21px; color: #33471f; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08); }
h3 { font-size: 16px; margin: 22px 0 12px; color: #4a5a2e; }
.home-cat { font-size: 14px; color: #7a7250; margin: 18px 0 10px; font-weight: 700; letter-spacing: 1px; }
.subtitle { color: #6b6a4e; margin-top: 8px; font-size: 14px; }
.hint { color: #9a9478; font-size: 12px; margin-top: 14px; }

/* ---------- 按钮：Minecraft 经典斜面按钮 ---------- */
.btn {
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
  background: linear-gradient(#9f9f9f 0%, #8a8a8a 50%, #6e6e6e 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -4px 0 rgba(0, 0, 0, 0.3),
    3px 3px 0 rgba(0, 0, 0, 0.35);
  transition: filter 0.15s, transform 0.05s, box-shadow 0.05s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.25);
}
.btn-primary { background: linear-gradient(var(--grass-lt) 0%, #57a02e 50%, #428522 100%); }
.btn-ghost { background: linear-gradient(#9f9f9f 0%, #8a8a8a 50%, #6e6e6e 100%); }
.btn-small { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 14px; }

/* ---------- 登录 ---------- */
.login-card { max-width: 460px; margin: 7vh auto 0; text-align: center; }
.login-card h1 { font-size: 30px; letter-spacing: 2px; text-shadow: 2px 2px 0 #b8dba0, 4px 4px 0 rgba(0, 0, 0, 0.18); }
.login-mobs { display: flex; justify-content: center; gap: 18px; margin-bottom: 18px; }
.login-mobs img {
  width: 66px; height: 66px; object-fit: cover;
  background: #8b8b8b;
  border-top: 3px solid #373737; border-left: 3px solid #373737;
  border-bottom: 3px solid #fdfdfd; border-right: 3px solid #fdfdfd;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
  animation: bob 2.4s ease-in-out infinite;
}
.login-mobs img:nth-child(2) { animation-delay: 0.4s; }
.login-mobs img:nth-child(3) { animation-delay: 0.8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
#login-form input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.12);
  margin-top: 22px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
#login-form input:focus { border-color: var(--grass); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(111, 191, 63, 0.35); }

/* ---------- 主页 ---------- */
.home-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.menu-btn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fbf9ec;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    4px 4px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border 0.15s, transform 0.08s, box-shadow 0.15s, background 0.15s;
}
.menu-btn:hover {
  border-color: var(--grass);
  background: #eef6df;
  transform: translate(-1px, -1px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    5px 5px 0 rgba(0, 0, 0, 0.3);
}
.menu-title { font-size: 17px; font-weight: 800; color: var(--grass-dk); }
.menu-desc { font-size: 13px; color: #6b6a4e; }

/* ---------- 测验 ---------- */
.quiz-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.quiz-tip { color: #6b6a4e; font-size: 13px; margin-top: 6px; }
.timer {
  background: rgba(16, 16, 16, 0.88);
  border: 2px solid #000;
  color: #d8ffd0;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}
.timer span { font-family: "SF Mono", Menlo, monospace; font-weight: 700; color: var(--xp); text-shadow: 1px 1px 0 #000; }
#quiz-questions { margin-top: 18px; border-top: 2px solid #e0dac2; }
.q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #e0dac2;
  flex-wrap: wrap;
}
.q-num { width: 30px; color: #9a9478; font-size: 14px; flex-shrink: 0; }
.q-word { font-weight: 800; color: var(--grass-dk); font-size: 16px; min-width: 110px; }
.q-word em { color: #9a9478; font-style: normal; }
.q-input {
  flex: 1;
  min-width: 120px;
  padding: 9px 12px;
  font-size: 15px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.1);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.q-input:focus { border-color: var(--grass); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(111, 191, 63, 0.3); }
.quiz-actions { display: flex; justify-content: center; gap: 14px; margin-top: 26px; }

/* ---------- 结果：经验等级方块 ---------- */
.score-circle {
  width: 130px;
  height: 130px;
  background: linear-gradient(135deg, #223311, #101c08);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px #5ea917, 6px 6px 0 rgba(0, 0, 0, 0.38), 0 0 26px rgba(128, 199, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 6px;
}
.score-circle span { font-size: 48px; font-weight: 900; color: #a5e84c; text-shadow: 3px 3px 0 #000; }
.result-comment { font-size: 16px; font-weight: 700; color: #4a5a2e; margin: 8px 0 4px; }
#result-badges { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.mini-badge { text-align: center; }
.mini-badge img {
  width: 78px; height: 78px; object-fit: cover;
  background: #8b8b8b;
  border-top: 3px solid #373737; border-left: 3px solid #373737;
  border-bottom: 3px solid #fdfdfd; border-right: 3px solid #fdfdfd;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}
.mini-badge.special img {
  border-top-color: #8a6d1d; border-left-color: #8a6d1d;
  border-bottom-color: #ffe9a8; border-right-color: #ffe9a8;
  box-shadow: 0 0 16px rgba(255, 215, 60, 0.7);
}
.mini-badge div { font-size: 12px; color: #6b6a4e; margin-top: 6px; font-weight: 600; }
.result-list { display: flex; flex-direction: column; gap: 8px; }
.r-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid;
}
.r-ok { background: #eef7e3; border-color: #a8d18a; }
.r-half { background: #fdf6dd; border-color: #e3cf8a; }
.r-bad { background: #fbe6e0; border-color: #e5a99c; }
.r-row .q-word { font-size: 14px; min-width: 0; }

/* ---------- 历史 ---------- */
.page-header { display: flex; justify-content: space-between; align-items: center; }
.tabs { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tab {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: linear-gradient(#9f9f9f, #7a7a7a);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.28), 2px 2px 0 rgba(0, 0, 0, 0.25);
}
.tab.active { background: linear-gradient(var(--grass-lt), var(--grass)); }
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.stat-chip {
  background: #f1ecd9;
  border: 2px solid var(--ink);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5a2e;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}
.chart-scroll { overflow-x: auto; background: var(--panel); border: 2px solid var(--ink); }
.h-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 13px; }
.h-table th, .h-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #ddd6bd; }
.h-table th { color: #6b6a4e; font-weight: 700; border-bottom: 2px solid var(--ink); }
.score-high { color: var(--grass); font-weight: 800; }

/* ---------- 徽章：物品栏格子 ---------- */
.badge-cat { font-size: 14px; color: #7a7250; margin: 16px 0 10px; font-weight: 700; letter-spacing: 1px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px; }
.badge-item {
  text-align: center;
  padding: 14px 8px;
  background: #efead6;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
}
.badge-item img {
  width: 84px; height: 84px; object-fit: cover;
  padding: 5px;
  background: #8b8b8b;
  border-top: 3px solid #373737; border-left: 3px solid #373737;
  border-bottom: 3px solid #fdfdfd; border-right: 3px solid #fdfdfd;
}
.badge-item.special img {
  border-top-color: #8a6d1d; border-left-color: #8a6d1d;
  border-bottom-color: #ffe9a8; border-right-color: #ffe9a8;
  box-shadow: 0 0 14px rgba(255, 215, 60, 0.65);
}
.badge-item.locked img { filter: grayscale(1); opacity: 0.35; box-shadow: none; }
.badge-name { font-size: 13px; font-weight: 700; margin-top: 8px; color: #4a5a2e; }
.badge-count { font-size: 12px; color: #7a7250; margin-top: 2px; }

/* ---------- 弹窗：成就提示风格 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(10, 16, 6, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-content {
  background: #232323;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px #5a5a5a, 8px 8px 0 rgba(0, 0, 0, 0.45);
  padding: 34px 40px;
  text-align: center;
  max-width: 90vw;
  animation: pop 0.35s ease;
}
.modal-content h2 { color: var(--mc-yellow); text-shadow: 2px 2px 0 #3f3f00; letter-spacing: 1px; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#modal-badges { display: flex; gap: 24px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.modal-badge img {
  width: 128px; height: 128px; object-fit: cover;
  padding: 6px;
  background: #8b8b8b;
  border-top: 4px solid #373737; border-left: 4px solid #373737;
  border-bottom: 4px solid #fdfdfd; border-right: 4px solid #fdfdfd;
}
.modal-badge.special img {
  border-top-color: #8a6d1d; border-left-color: #8a6d1d;
  border-bottom-color: #ffe9a8; border-right-color: #ffe9a8;
  box-shadow: 0 0 26px rgba(255, 215, 60, 0.85);
}
.modal-badge div { margin-top: 12px; font-weight: 700; color: #e8e8e8; }

@media (max-width: 640px) {
  .card { padding: 22px; }
  .menu-grid { grid-template-columns: 1fr; }
  .r-row { grid-template-columns: 1fr; gap: 4px; }
  .q-word { min-width: 80px; }
}
