/* ============================================================
   还记得吗 —— 考古问答。沿用 book.css 的书房与纸页，
   这里只加答题相关的部分。
   ============================================================ */

.q-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.q-screen[hidden] { display: none; }

/* --- 开始页 --- */
#intro { align-items: center; justify-content: center; text-align: center; }
#intro h1 {
  margin: 0 0 16px;
  font-family: var(--hand); font-weight: 400;
  font-size: clamp(24px, 6.4vw, 31px); letter-spacing: .14em;
  color: var(--ink);
}
.q-sub {
  margin: 0 0 34px;
  font-family: var(--hand); font-size: 14.5px; line-height: 2;
  letter-spacing: .05em; color: var(--ink-soft);
}
.q-note {
  margin: 18px 0 0;
  font-family: var(--hand); font-size: 12px; letter-spacing: .08em;
  color: #a4947a;
}

/* --- 按钮 --- */
.q-btn {
  align-self: center;
  padding: 12px 34px;
  border: 1px solid #8f7a5b; border-radius: 3px;
  background: transparent; color: var(--ink);
  font-family: var(--hand); font-size: 17px; letter-spacing: .18em;
  cursor: pointer;
  transition: background .25s, border-color .25s, opacity .25s;
}
.q-btn:hover:not(:disabled) { background: #8f7a5b1a; border-color: var(--ink-soft); }
.q-btn:disabled { opacity: .45; cursor: default; }
.q-btn--sm { padding: 9px 26px; font-size: 15px; }

.q-link {
  font-family: var(--hand); font-size: 14px; letter-spacing: .1em;
  color: var(--ink-soft); text-decoration: none;
  border-bottom: 1px solid #b0a08466;
}
.q-link:hover { color: var(--ink); }

/* --- 进度 --- */
.q-bar {
  flex: none;
  height: 2px; margin-bottom: 14px;
  background: #c3b393;
  border-radius: 2px; overflow: hidden;
}
.q-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #a8875a, var(--seal));
  transition: width .45s ease;
}
.q-count {
  flex: none; margin: 0 0 18px;
  font-family: var(--hand); font-size: 12.5px; letter-spacing: .16em;
  color: #a4947a;
}
.q-count b { color: var(--ink-soft); font-weight: 400; font-size: 15px; }

/* --- 题干 --- */
.q-text {
  flex: none; margin: 0 0 22px;
  font-family: var(--hand); font-weight: 400;
  font-size: clamp(17px, 4.6vw, 20px); line-height: 1.95; letter-spacing: .04em;
  color: var(--ink);
}

/* --- 选项 --- */
.q-options { flex: none; display: flex; flex-direction: column; gap: 10px; }

.q-opt {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 12px 14px;
  border: 1px solid #bfae8e; border-radius: 3px;
  background: #fdf8ec55;
  font-family: var(--hand); font-size: 15.5px; line-height: 1.75;
  letter-spacing: .03em; color: var(--ink);
  text-align: left; cursor: pointer;
  transition: background .2s, border-color .2s, opacity .3s;
}
.q-opt:hover:not(:disabled) { background: #fdf8ecaa; border-color: #9c8967; }
.q-opt:disabled { cursor: default; }

.q-opt i {
  flex: none;
  width: 19px; height: 19px; margin-top: 2px;
  display: grid; place-items: center;
  border: 1px solid #b0a084; border-radius: 50%;
  font-style: normal; font-size: 11px; color: #8a7659;
}

/* 判过之后 */
.q-opt.right { border-color: #6d8a5e; background: #eef3e5; }
.q-opt.right i { border-color: #6d8a5e; background: #6d8a5e; color: #f4f7ee; }
.q-opt.wrong { border-color: #a8635a; background: #f6e9e6; }
.q-opt.wrong i { border-color: #a8635a; background: #a8635a; color: #f9efed; }
.q-opt.dim { opacity: .42; }

/* --- 出处 --- */
.q-why {
  flex: none;
  margin-top: 18px; padding: 13px 15px;
  border-left: 2px solid #b0a084;
  background: #00000006;
  font-family: var(--hand); font-size: 14px; line-height: 1.95;
  letter-spacing: .03em; color: var(--ink-soft);
  animation: why-in .45s ease;
}
.q-why[hidden] { display: none; }
@keyframes why-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

#q-next { margin-top: 20px; }

/* --- 结果 --- */
#done { align-items: center; justify-content: center; text-align: center; }
.q-score-label {
  margin: 0 0 6px;
  font-family: var(--hand); font-size: 14px; letter-spacing: .16em;
  color: var(--ink-soft);
}
.q-score { margin: 0 0 24px; font-family: var(--hand); color: var(--ink); }
.q-score b { font-size: 62px; font-weight: 400; letter-spacing: .02em; }
.q-score span { font-size: 22px; color: #a4947a; margin-left: 4px; }

.q-comment {
  max-width: 30em; margin: 0 0 30px;
  font-family: var(--hand); font-size: 16px; line-height: 2.1;
  letter-spacing: .04em; color: var(--ink);
  white-space: pre-wrap;
}

.q-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.q-err {
  margin: 0 0 22px;
  font-family: var(--hand); font-size: 15px; line-height: 1.9;
  color: #9c6055; text-align: center;
}
#oops { align-items: center; justify-content: center; }
#oops p { margin: 14px 0 0; }

/* --- 出题等待 --- */
.q-wait {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  font-family: var(--hand); font-size: 14px; letter-spacing: .1em;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .q-why { animation: none; }
  .q-bar i { transition: none; }
}
