/* style.css — 脑力大挑战 移动端优先样式 */
:root {
  --bg: #FAF7F2;          /* 暖纸色 */
  --card: #FFFFFF;
  --ink: #2B2622;         /* 墨色文字 */
  --ink-soft: #8A8178;
  --primary: #C8402A;     /* 朱砂红 */
  --primary-deep: #A8331F;
  --accent: #E8843C;      /* 暖橙 */
  --good: #3E9B5F;        /* 正确绿 */
  --bad: #C0392B;         /* 错误红 */
  --line: #ECE5DA;
  --shadow: 0 4px 18px rgba(80, 60, 40, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: #EFE9E0;
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 0 30px rgba(0,0,0,.06);
}

.page { display: none; padding: 20px 18px 40px; min-height: 100vh; }
.page.active { display: block; }

/* ---------- 首页 ---------- */
.home-head { text-align: center; padding: 30px 0 18px; }
.logo-mark {
  width: 64px; height: 64px; margin: 0 auto 10px;
  background: var(--primary); color: #fff;
  border-radius: 16px; font-size: 34px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.app-name { font-size: 28px; margin: 6px 0 2px; letter-spacing: 2px; }
.slogan { color: var(--ink-soft); margin: 0; font-size: 15px; }

.today-card {
  background: var(--card); border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow); margin-top: 14px;
}
.today-row { display: flex; justify-content: space-between; align-items: center; }
.today-level { font-size: 18px; font-weight: 700; }
.today-state {
  font-size: 13px; color: var(--primary);
  background: #FBEAE6; padding: 3px 12px; border-radius: 20px;
}
.today-stats { display: flex; margin: 18px 0; }
.stat { flex: 1; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--primary-deep); }
.stat-label { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.btn-primary {
  width: 100%; min-height: 52px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #fff; font-size: 19px; font-weight: 700;
  border-radius: 14px; padding: 14px;
  box-shadow: 0 6px 16px rgba(200,64,42,.3);
}
.btn-primary:active { transform: translateY(1px); }

.how-card { background: var(--card); border-radius: 20px; padding: 18px; margin-top: 16px; box-shadow: var(--shadow); }
.how-title { font-weight: 700; margin-bottom: 12px; font-size: 16px; }
.how-list { display: flex; gap: 10px; }
.how-item {
  flex: 1; background: var(--bg); border-radius: 14px; padding: 12px 8px;
  text-align: center; font-size: 13px; color: var(--ink-soft);
}
.how-item b { color: var(--ink); font-size: 14px; }
.how-ico { font-size: 26px; display: block; margin-bottom: 6px; }

.foot { text-align: center; color: var(--ink-soft); font-size: 12px; margin-top: 26px; }

/* ---------- 游戏页 ---------- */
.game-top { display: flex; align-items: center; gap: 10px; padding: 6px 0 16px; }
.quit-btn {
  border: none; background: none; color: var(--ink-soft);
  font-size: 16px; min-width: 44px; min-height: 44px; cursor: pointer;
}
.progress-wrap { flex: 1; }
.progress-bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 10%; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width .3s; border-radius: 6px; }
.progress-text { font-size: 12px; color: var(--ink-soft); margin-top: 4px; text-align: center; }
.cur-score { font-size: 15px; font-weight: 700; color: var(--primary-deep); min-width: 50px; text-align: right; }

.q-card { background: var(--card); border-radius: 20px; padding: 22px 18px; box-shadow: var(--shadow); }
.q-type-tag {
  display: inline-block; font-size: 12px; color: #fff; background: var(--accent);
  padding: 2px 10px; border-radius: 10px; margin-bottom: 14px;
}
.q-prompt { font-size: 17px; color: var(--ink-soft); margin-bottom: 14px; }

/* 补全成语大字 */
.idom-blank {
  display: flex; justify-content: center; gap: 10px; margin: 10px 0 22px;
}
.idom-char {
  width: 60px; height: 60px; line-height: 60px; text-align: center;
  font-size: 34px; font-weight: 700; background: var(--bg); border-radius: 12px;
}
.idom-char.blank { color: var(--primary); border: 2px dashed var(--primary); background: #FBEAE6; }

/* 表情题 */
.emoji-line { text-align: center; font-size: 46px; letter-spacing: 6px; margin: 16px 0 24px; }

/* 选项按钮 */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-btn {
  min-height: 52px; border: 2px solid var(--line); background: var(--bg);
  border-radius: 12px; font-size: 20px; padding: 10px; cursor: pointer;
  color: var(--ink); font-family: inherit;
}
.opt-btn.single { font-size: 26px; font-weight: 700; }
.opt-btn.correct { background: #E5F4EA; border-color: var(--good); color: var(--good); }
.opt-btn.wrong { background: #FBE9E7; border-color: var(--bad); color: var(--bad); }
.opt-btn:disabled { cursor: default; }

/* 反馈释义 */
.feedback {
  margin-top: 16px; min-height: 30px; font-size: 15px;
  border-radius: 12px; padding: 12px 14px; display: none;
}
.feedback.show { display: block; }
.feedback.good { background: #E5F4EA; color: #2C6E45; }
.feedback.bad { background: #FBE9E7; color: #9B2A20; }
.feedback .fb-ans { font-weight: 700; }

/* 消除题 */
.elim-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 16px;
}
.elim-cell {
  height: 60px; line-height: 60px; text-align: center; font-size: 28px; font-weight: 700;
  background: var(--bg); border-radius: 12px; cursor: pointer; user-select: none;
}
.elim-cell.picked { background: #FBEAE6; color: var(--primary); }
.elim-cell.done { background: transparent; color: var(--line); border: 1px dashed var(--line); cursor: default; }
.elim-cell.wrongflash { background: #FBE9E7; }
.elim-current {
  min-height: 44px; text-align: center; font-size: 26px; font-weight: 700;
  letter-spacing: 8px; color: var(--primary); margin: 6px 0 12px;
}
.elim-actions { display: flex; gap: 10px; }
.elim-actions button {
  flex: 1; min-height: 46px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-ad-tip { color: var(--accent); border-color: #F3D9C2 !important; }

/* ---------- 结果页 ---------- */
.result-card { background: var(--card); border-radius: 22px; padding: 30px 22px; text-align: center; box-shadow: var(--shadow); margin-top: 30px; }
.result-emoji { font-size: 56px; }
.result-rating { font-size: 22px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.result-score { font-size: 56px; font-weight: 800; }
.result-total { font-size: 26px; color: var(--ink-soft); }
.result-brain { margin-top: 14px; font-size: 17px; }
.result-brain b { color: var(--primary-deep); font-size: 22px; }
.result-streak { color: var(--ink-soft); margin: 8px 0 22px; }
.btn-ad {
  width: 100%; min-height: 50px; margin-top: 12px;
  border: 2px dashed var(--accent); background: #FFF6EE; color: var(--accent);
  border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
}

/* ---------- 广告演示模态 ---------- */
.ad-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.ad-modal {
  width: 78%; max-width: 320px; background: #fff; border-radius: 18px;
  padding: 24px 20px; text-align: center;
}
.ad-tag { font-size: 12px; color: var(--accent); background: #FFF0E3; display: inline-block; padding: 3px 12px; border-radius: 12px; margin-bottom: 12px; }
.ad-body { font-size: 16px; margin-bottom: 16px; }
.ad-bar { height: 6px; background: #eee; border-radius: 4px; overflow: hidden; }
.ad-bar-fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width 1.5s linear; }
.ad-hint { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }
