/* 成语接龙 · DaoBox 家族（v0.1.0） */
:root {
  --bg: #faf6ee;
  --board: #f5ead7;
  --cell: #ffffff;
  --text: #3d2f1f;
  --muted: #9a8a70;
  --accent: #b91c1c;
  --gold: #d97706;
  --green: #16a34a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 顶栏 ---------- */
.topbar { background: #fff; border-bottom: 1px solid rgba(0,0,0,.06); }
.topbar-inner {
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.brand { font-size: 17px; font-weight: 700; }
.topbar-tools { display: inline-flex; align-items: center; gap: 6px; }
.version-badge { font-size: 11px; color: #6b7280; background: #f3f4f6; border-radius: 999px; padding: 3px 7px; }
.refresh-btn { width: 26px; height: 26px; padding: 0; border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #6b7280; font-size: 15px; line-height: 1; cursor: pointer; }
.refresh-btn:hover { color: var(--accent); border-color: #fca5a5; }

/* ---------- 主体 ---------- */
.page { max-width: 560px; width: 100%; margin: 0 auto; padding: 14px 16px 32px; flex: 1; }

.mode-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.mode-btn {
  flex: 1; border: 2px solid transparent; border-radius: 10px;
  padding: 10px 0; font-size: 15px; font-weight: 700;
  background: #efe6d4; color: #8a7350; cursor: pointer;
}
.mode-btn.active { background: var(--accent); color: #fff; }

.hud { display: flex; gap: 10px; margin-bottom: 12px; }
.score-box { flex: 1; background: var(--board); border-radius: 10px; padding: 8px 12px; text-align: center; }
.score-label { font-size: 12px; color: var(--muted); }
.score-value { font-size: 24px; font-weight: 800; line-height: 1.2; }

/* ---------- 接龙链条 ---------- */
.chain-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px;
  margin-bottom: 10px; scrollbar-width: none;
}
.chain-strip::-webkit-scrollbar { display: none; }
.chain-chip {
  flex-shrink: 0; background: #fff; border: 1px solid #e7dcc4;
  border-radius: 8px; padding: 5px 9px; font-size: 13px; font-weight: 700;
  color: #6b5637; white-space: nowrap;
}
.chain-chip.latest { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 题目 ---------- */
.question-card {
  background: var(--board); border-radius: 14px;
  padding: 18px 16px; text-align: center; margin-bottom: 14px;
}
.question-title { font-size: 17px; font-weight: 700; line-height: 1.6; }
.question-title b { color: var(--accent); font-size: 22px; }
.question-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.blank-idiom {
  font-size: 34px; font-weight: 800; letter-spacing: 6px;
  margin-top: 10px; line-height: 1.3;
}
.blank-idiom .hole {
  display: inline-block; min-width: 1.2em; text-align: center;
  border-bottom: 3px solid var(--accent); color: var(--accent);
}

/* ---------- 选项 ---------- */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  border: 2px solid #e7dcc4; border-radius: 12px; background: var(--cell);
  padding: 12px 8px; text-align: center; cursor: pointer;
  transition: transform .1s ease, border-color .1s ease;
}
.opt:active { transform: scale(.96); }
.opt .opt-word { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.opt .opt-py { font-size: 12px; color: var(--muted); margin-top: 3px; }
.opt.correct { border-color: var(--green); background: #f0fdf4; }
.opt.correct .opt-word { color: var(--green); }
.opt.wrong { border-color: var(--accent); background: #fef2f2; opacity: .75; }
.opt.dim { opacity: .45; }
.options.locked .opt { cursor: default; }

/* ---------- 反馈 ---------- */
.feedback {
  margin-top: 12px; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; font-weight: 700; text-align: center;
}
.feedback.good { background: #f0fdf4; color: var(--green); }
.feedback.bad { background: #fef2f2; color: var(--accent); }
.feedback.hidden { display: none; }

.btn-row { display: flex; justify-content: center; margin-top: 12px; }
.btn {
  border: none; border-radius: 8px;
  padding: 9px 22px; font-size: 14px; font-weight: 700;
  background: #efe6d4; color: #6b5637; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; }

/* ---------- 说明 ---------- */
.tips { margin-top: 20px; background: #fff; border-radius: 12px; padding: 14px 16px; }
.tips h2 { font-size: 15px; margin: 0 0 8px; }
.tips ul { margin: 0; padding-left: 18px; }
.tips li { font-size: 13px; line-height: 1.8; color: #6b5637; }

/* ---------- 时长锁 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-card {
  background: #fff; border-radius: 16px; padding: 24px 28px;
  max-width: 300px; width: calc(100% - 48px); text-align: center;
}
.win-emoji { font-size: 40px; }
.modal-card h3 { margin: 10px 0 6px; font-size: 17px; }
.modal-card p { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.modal-btns { display: flex; flex-direction: column; gap: 8px; }
.primary-btn {
  display: block; background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 10px; padding: 10px 0; font-weight: 700; font-size: 15px;
}
.secondary-btn {
  background: #f3f4f6; color: #4b5563; border: none;
  border-radius: 10px; padding: 10px 0; font-weight: 700; font-size: 15px; cursor: pointer;
}

/* ---------- 页脚 ---------- */
.footer {
  max-width: 560px; width: 100%; margin: 0 auto;
  padding: 14px 16px 24px; text-align: center;
  font-size: 13px; color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer .dot { margin: 0 6px; }
#contact-email a { color: var(--muted); }

.modal-mask.hidden { display: none; }
