/* ============================================================
   palace.css — 站 4「紫禁城与科举」站内样式
   背景：base.css 定暗金展览令牌；本文件做中轴热点与闯关布局。
   设计意图：热点建筑点击亮起（金描边+淡金底），说明卡联动；
             科举三关用进度灯 + 选项按钮，答错给解释可重试，
             全过后亮朱砂「进士及第」印章。
   ============================================================ */

.head-actions { display: flex; gap: var(--sp); align-items: center; }
.back-link { text-decoration: none; }

.lesson-head { padding: calc(var(--sp) * 5) 0 calc(var(--sp) * 3); }
.kicker { font-size: var(--fs-sm); letter-spacing: .14em; margin-bottom: var(--sp); }
.lesson-head h1 { font-size: var(--fs-xl); margin-bottom: calc(var(--sp) * 2); }
.intro { max-width: 640px; color: var(--ink-soft); }

.zone-title { font-size: var(--fs-lg); margin: calc(var(--sp) * 3) 0 calc(var(--sp) * 2); }

/* ---------- 建筑图卡（LibTV 生图，替代旧 SVG 中轴） ---------- */
.bld-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--sp) * 2);
}
.bld-card {
  font: inherit;
  padding: 0;
  background: var(--paper-2);
  border: 2px solid var(--line-dim);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.bld-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.bld-card .bld-name {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink);
  padding: .5em .3em .6em;
}
.bld-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(120, 60, 30, 0.2);
}
.bld-card.active {
  border-color: var(--zhu);
  box-shadow: 0 0 0 3px var(--zhu-mist);
}
.bld-card.active .bld-name { color: var(--zhu); }

.bld-card-info {
  margin-top: calc(var(--sp) * 2.5);
  background: var(--zhu-mist);
  border: 1px solid var(--line);
  border-left: 4px solid var(--zhu);
  border-radius: var(--radius);
  padding: calc(var(--sp) * 2.5) calc(var(--sp) * 3);
  min-height: 96px;
}
.bld-card-info h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  color: var(--zhu);
  margin-bottom: calc(var(--sp) * 1.2);
}
.bld-card-info p { margin: 0; max-width: 700px; }

/* ---------- 科举闯关 ---------- */
.exam-wrap {
  background: var(--paper-2);
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  padding: calc(var(--sp) * 3);
}
.exam-lvls { display: flex; gap: calc(var(--sp) * 1.5); margin-bottom: calc(var(--sp) * 2.5); }
.lvl {
  flex: 1;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 3px solid var(--line-dim);
  padding-bottom: calc(var(--sp) * 0.8);
}
.lvl.passed { color: var(--gold); border-bottom-color: var(--gold); }
.lvl.now { color: var(--zhu); border-bottom-color: var(--zhu); }

.exam-q h3 { font-size: var(--fs-md); margin-bottom: calc(var(--sp) * 2); }
.exam-opts { display: grid; gap: calc(var(--sp) * 1.2); max-width: 560px; }
.opt-btn {
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--paper-3);
  border: 1.5px solid var(--line-dim);
  border-radius: var(--radius);
  padding: .7em 1em;
  cursor: pointer;
  display: flex;
  gap: .6em;
  align-items: baseline;
}
.opt-btn:hover { border-color: var(--gold); background: var(--gold-mist); }
.opt-btn .key { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.opt-btn.right { border-color: var(--gold); background: var(--gold-mist); }
.opt-btn.wrong { border-color: var(--zhu); background: var(--zhu-mist); }

.exam-explain {
  margin-top: calc(var(--sp) * 2);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
  padding-left: calc(var(--sp) * 1.5);
}

.exam-done { text-align: center; padding: calc(var(--sp) * 2) 0; }
.exam-done .seal-big {
  display: inline-grid;
  place-items: center;
  width: 110px;
  height: 110px;
  background: var(--zhu);
  color: #fff8ea;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.35;
  border-radius: 8px;
  box-shadow: inset 0 0 0 3px rgba(243, 230, 216, 0.4);
  transform: rotate(-4deg);
  margin-bottom: calc(var(--sp) * 2);
}
.exam-done h3 { font-size: var(--fs-lg); }
.exam-done p { color: var(--ink-soft); max-width: 540px; margin: 0 auto; }

.ending { text-align: center; padding-bottom: calc(var(--sp) * 6); }

@media (max-width: 760px) {
  .bld-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-opts { grid-template-columns: 1fr; }
}
