/* 每日脑力一练 —— 全局样式（中老年可用性优先：大字、大按钮、高对比、即时反馈） */
:root {
  --bg: #FBF5EA;          /* 米白底 */
  --card: #FFFFFF;
  --ink: #2B2118;         /* 深字 */
  --ink-soft: #6B5D4F;
  --primary: #C2570B;     /* 深橙主色 */
  --primary-dark: #9A4506;
  --primary-soft: #FBEEDD;
  --good: #1E7D46;
  --bad: #C22F1D;
  --line: #E7DCC8;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

#app { max-width: 480px; margin: 0 auto; padding: 0 16px 24px; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.site-header { text-align: center; padding: 22px 0 10px; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--primary-dark); }
.brand-sub { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- 页脚声明 ---------- */
.site-footer {
  margin-top: 28px; padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); text-align: center; line-height: 1.7;
}

/* ---------- 通用卡片与按钮 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0; box-shadow: 0 2px 8px rgba(90, 60, 20, .06);
}

.btn {
  display: block; width: 100%; min-height: 56px; padding: 12px 20px;
  font-size: 20px; font-weight: 700; font-family: inherit;
  color: var(--ink); background: #fff; border: 2px solid var(--primary);
  border-radius: var(--radius); cursor: pointer; text-align: center;
  transition: background-color .08s, transform .08s;
}
.btn:active { background: var(--primary-soft); transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); font-weight: 600; }
.btn-ghost:active { background: #F3EBDC; }
.btn-row { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.chip {
  display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
  font-size: 15px; font-weight: 700; border-radius: 999px; padding: 3px 12px;
}
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.big-num { font-size: 34px; font-weight: 800; }

/* ---------- 首页 ---------- */
.today-card { border: 2px solid var(--primary); }
.today-date { font-size: 16px; color: var(--ink-soft); }
.today-name { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.today-rule { font-size: 18px; margin: 8px 0 14px; }
.done-banner {
  background: #EAF6EE; border: 1px solid #BFE3CC; color: var(--good);
  border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-bottom: 12px; text-align: center;
}

.streak-card { display: flex; align-items: center; justify-content: space-around; text-align: center; }
.streak-card .big-num { color: var(--primary-dark); }
.streak-label { font-size: 15px; color: var(--ink-soft); }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.week-cell {
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  padding: 8px 2px; text-align: center; cursor: pointer; font-family: inherit;
}
.week-cell:active { background: var(--primary-soft); }
.week-cell .dow { font-size: 14px; color: var(--ink-soft); }
.week-cell .mark { font-size: 20px; font-weight: 800; height: 26px; line-height: 26px; }
.week-cell .gname { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.week-cell.is-today { border-color: var(--primary); background: var(--primary-soft); }
.week-cell.is-done .mark { color: var(--good); }
.week-cell.is-future { opacity: .55; }

.game-list { list-style: none; margin: 10px 0 0; padding: 0; }
.game-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.game-list li:last-child { border-bottom: none; }
.game-list .g-info { flex: 1; }
.game-list .g-name { font-weight: 700; font-size: 19px; }
.game-list .g-best { font-size: 14px; color: var(--ink-soft); }
.btn-practice {
  flex: 0 0 auto; min-height: 52px; padding: 8px 18px; font-size: 17px; font-weight: 700;
  font-family: inherit; background: #fff; color: var(--primary-dark);
  border: 2px solid var(--primary); border-radius: 12px; cursor: pointer;
}
.btn-practice:active { background: var(--primary); color: #fff; }

.tomorrow { text-align: center; color: var(--ink-soft); font-size: 17px; }
.tomorrow b { color: var(--ink); }

/* ---------- 游戏通用 ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; }
.game-title { font-size: 24px; font-weight: 800; }
.btn-quit {
  min-height: 48px; padding: 6px 16px; font-size: 16px; font-family: inherit;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink-soft); cursor: pointer;
}
.btn-quit:active { background: #F3EBDC; }
.mode-note { font-size: 15px; color: var(--ink-soft); margin-bottom: 8px; }
.timer-line { font-size: 20px; font-weight: 700; text-align: center; min-height: 32px; }
.feedback { text-align: center; font-size: 19px; font-weight: 700; min-height: 30px; }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }

.progress-track { height: 12px; background: #EFE6D4; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; background: var(--primary); width: 100%; transition: width .2s linear; }

/* 抖动反馈（点错时） */
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake .28s ease 2; }
.flash-bad { background: #FBE3DE !important; border-color: var(--bad) !important; }

/* ---------- 舒尔特方格 ---------- */
.schulte-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.schulte-cell {
  aspect-ratio: 1; font-size: 27px; font-weight: 800; font-family: inherit;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink);
}
.schulte-cell:active { background: var(--primary-soft); }
.schulte-cell.done { background: #EAF6EE; border-color: #BFE3CC; color: var(--good); opacity: .65; }

/* ---------- 记忆翻牌 ---------- */
.flip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.flip-card {
  aspect-ratio: 1; font-size: 34px; font-family: inherit;
  background: var(--primary); border: 2px solid var(--primary-dark); border-radius: 12px;
  cursor: pointer; color: #fff; font-weight: 800;
}
.flip-card.open { background: #fff; border-color: var(--line); }
.flip-card.matched { background: #EAF6EE; border-color: #BFE3CC; opacity: .7; cursor: default; }

/* ---------- Stroop ---------- */
.stroop-word { font-size: 76px; font-weight: 900; text-align: center; padding: 26px 0 10px; letter-spacing: 6px; }
.stroop-q { text-align: center; font-size: 18px; color: var(--ink-soft); }
.stroop-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.stroop-btns .btn-color:last-child { grid-column: 1 / -1; }
.btn-color {
  min-height: 60px; font-size: 22px; font-weight: 800; font-family: inherit;
  border: none; border-radius: 12px; cursor: pointer; color: #fff;
}
.btn-color:active { transform: scale(.97); filter: brightness(1.15); }

/* ---------- 数字记忆 ---------- */
.digit-show { font-size: 52px; font-weight: 900; letter-spacing: 8px; text-align: center; padding: 30px 0 6px; word-break: break-all; }
.digit-input {
  width: 100%; font-size: 30px; font-weight: 800; text-align: center; letter-spacing: 6px;
  padding: 14px 8px; border: 2px solid var(--primary); border-radius: 12px; font-family: inherit;
  color: var(--ink); background: #fff;
}

/* ---------- 火眼金睛 ---------- */
.spot-grid { display: grid; gap: 8px; margin: 12px auto 0; max-width: 340px; }
.spot-cell {
  aspect-ratio: 1; font-size: 34px; font-family: inherit; line-height: 1;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
}
.spot-cell:active { background: var(--primary-soft); }

/* ---------- 词语回忆 ---------- */
.word-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.word-item {
  font-size: 22px; font-weight: 700; background: var(--primary-soft); color: var(--ink);
  border-radius: 10px; padding: 10px 16px;
}
.word-chip {
  font-size: 20px; font-weight: 700; font-family: inherit; padding: 12px 16px; min-height: 52px;
  background: #fff; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--ink);
}
.word-chip:active { transform: scale(.97); }
.word-chip.selected { background: var(--primary); border-color: var(--primary-dark); color: #fff; }

/* ---------- 顺序点灯 ---------- */
.light-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 14px auto 0; }
.light-cell {
  aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line); background: #EFE7D6;
  cursor: pointer; font-family: inherit;
}
.light-cell.lit { background: #F5A623; border-color: #D98A06; }
.light-cell:active { background: #E2D5B8; }
.light-cell.lit:active { background: #F5A623; }

/* ---------- 结果页 ---------- */
.result-score { text-align: center; padding: 10px 0 2px; }
.result-score .score-main { font-size: 40px; font-weight: 900; color: var(--primary-dark); line-height: 1.3; }
.result-score .score-detail { font-size: 18px; color: var(--ink-soft); }
.record-banner {
  text-align: center; font-weight: 800; font-size: 20px; color: var(--good);
  background: #EAF6EE; border-radius: 10px; padding: 10px; margin-top: 12px;
}
.best-line { text-align: center; color: var(--ink-soft); margin-top: 10px; }
.insight-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.insight p { margin: 6px 0; }
.tip-box {
  background: var(--primary-soft); border-radius: 10px; padding: 12px 14px; margin-top: 14px;
}
.tip-box .tip-label { font-weight: 800; color: var(--primary-dark); }
.poster-wrap { text-align: center; margin-top: 14px; }
.poster-wrap img { width: 100%; max-width: 340px; border: 1px solid var(--line); border-radius: 10px; }
.poster-hint { color: var(--ink-soft); font-size: 16px; margin-top: 8px; }
.article-slot { margin-top: 14px; text-align: center; font-size: 16px; color: var(--ink-soft); }
.article-slot a { color: var(--primary-dark); font-weight: 700; }
