/* ===== 题库 · 实验/填空/综合 影印版 ===== */
body.ex-page { background: #eef1f6; }

.exbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #d8dee9;
  padding: 10px 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.exbar .ex-title { font-size: 16px; font-weight: 700; color: #1f2937; }
.exbar .ex-title small { font-weight: 400; color: #6b7280; font-size: 12px; margin-left: 8px; }
.exbar .grow { flex: 1; }
.exbar input[type=search] {
  width: 200px; padding: 7px 11px; font-size: 13px;
  border: 1px solid #cbd5e1; border-radius: 8px; outline: none;
}
.exbar input[type=search]:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.exbar button {
  padding: 7px 13px; font-size: 13px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; color: #374151;
  border-radius: 8px;
}
.exbar button:hover { background: #f3f4f6; border-color: #9ca3af; }
.exbar button.on { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.exbar a.back { font-size: 13px; color: #4f46e5; text-decoration: none; }
.exbar a.back:hover { text-decoration: underline; }

.exwrap { max-width: 940px; margin: 0 auto; padding: 20px 16px 90px; }

/* 顶部说明 */
.exnote {
  background: #fff; border: 1px solid #dfe4ec; border-left: 4px solid #4f46e5;
  border-radius: 10px; padding: 12px 16px; margin: 0 0 20px;
  font-size: 13px; color: #475569; line-height: 1.75;
}
.exnote b { color: #1e293b; }
.exnote code {
  background: #f1f5f9; border-radius: 4px; padding: 1px 5px;
  font-size: 12px; color: #4338ca;
}

/* 模式卡片 */
.ex-card {
  background: #fff; border: 1px solid #dfe4ec; border-radius: 12px;
  margin: 0 0 22px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
  scroll-margin-top: 64px;
}
.ex-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #f7f9fc;
  border-bottom: 1px solid #e5eaf2;
}
.ex-head .idx {
  font-size: 12px; font-weight: 700; color: #fff;
  background: #4f46e5; border-radius: 6px; padding: 3px 8px;
}
.ex-head .cn { font-size: 16px; font-weight: 700; color: #111827; }
.ex-head .en { font-size: 12px; color: #94a3b8; }
.ex-head .tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid;
}
.tag.create { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tag.struct { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.tag.behav  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ex-head .src { font-size: 11px; color: #94a3b8; margin-left: auto; }

/* 题型分区 */
.ex-sec { border-top: 1px solid #eef1f6; }
.ex-sec:first-of-type { border-top: none; }
.ex-sec > .st {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 6px;
  font-size: 13px; font-weight: 700; color: #334155;
}
.ex-sec > .st .badge {
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
}
.ex-sec > .st .ref { font-size: 11px; font-weight: 400; color: #94a3b8; margin-left: auto; }

.qbox, .abox { padding: 0 10px 8px; }
.abox { border-top: 1px dashed #e2e8f0; }
.qbox img, .abox img {
  display: block; width: 100%; height: auto; background: #fff;
}
.abox .lbl, .qbox .lbl {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 7px 4px 4px;
}
.qbox .lbl { color: #64748b; }
.abox .lbl { color: #047857; }

/* 折叠态 */
.ex-card.closed .abox img, .ex-card.closed .abox .lbl { display: none; }
.ex-card.closed .abox::after {
  content: "答案已折叠 · 点右上「展开全部答案」查看";
  display: block; padding: 16px 4px; text-align: center;
  font-size: 12px; color: #94a3b8;
}

/* 实验题答案来源提示 */
.hint {
  font-size: 11px; color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 6px;
  padding: 5px 9px; margin: 4px 4px 0;
}

.ex-empty { text-align: center; color: #94a3b8; padding: 60px 0; font-size: 14px; }

@media (max-width: 640px) {
  .exwrap { padding: 12px 9px 70px; }
  .exbar input[type=search] { width: 120px; }
  .ex-head .src { display: none; }
}
@media print {
  .exbar { display: none; }
  .ex-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
}

/* ==========================================================
   移动端适配（手机竖屏 ≤640px）— 填空题总练
   ========================================================== */
@media (max-width: 640px) {
  /* --- 顶栏 --- */
  .exbar { padding: 8px 10px; gap: 8px; }
  .exbar .ex-title { font-size: 14px; width: 100%; }
  .exbar .ex-title small { display: block; margin-left: 0; margin-top: 2px; }
  .exbar input[type=search] { flex: 1 1 auto; width: auto !important; min-width: 0; font-size: 16px; }
  .exbar button { padding: 8px 12px; font-size: 13px; }
  .exbar a.back { order: 9; }

  /* --- 说明与卡片 --- */
  .exwrap { padding: 12px 9px 40px !important; }
  .exnote { font-size: 12.5px; padding: 10px 12px; }
  .ex-head { padding: 10px 12px; gap: 8px; }
  .ex-head .cn { font-size: 15px; }
  .ex-sec > .st { padding: 8px 12px 4px; flex-wrap: wrap; }

  .ex-card img { touch-action: auto; }
  .qbox, .abox { padding: 0 6px 6px; }

  html, body { overflow-x: hidden; }
}
