/* 试题详情页左右分栏布局：与全站统一页头/页脚（SiteChrome）搭配使用。
   基础排版由 question-detail.css 提供，本文件只负责分栏骨架、右侧推荐栏与响应式堆叠。 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.7;
}

/* ---------- 分栏容器 ---------- */
.q-layout-wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 0; }
.q-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.q-main { min-width: 0; }
.q-side { min-width: 0; }

/* 面包屑：顶栏下方，弱化当前项 */
.crumb {
  font-size: 13px; color: #64748b; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
}
.crumb a { color: #475569; text-decoration: none; }
.crumb a:hover { color: #2563eb; }
.crumb a.cur, .crumb a.cur:hover { color: #0f172a; font-weight: 600; background: none; cursor: default; }
.crumb .sep { margin: 0 4px; color: #cbd5e1; }

/* ---------- 左侧：试题详情卡 ---------- */
.q-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 26px 28px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.q-card .q-stem {
  font-size: 21px; font-weight: 600; line-height: 1.8; margin: 0 0 18px;
  white-space: pre-wrap; color: #0f172a; letter-spacing: .2px;
}
.q-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.q-tags .tag {
  font-size: 12px; color: #334155; background: #f1f5f9;
  border: 1px solid #e2e8f0; border-radius: 999px; padding: 3px 11px;
}
.q-tags .tag-primary { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; font-weight: 600; }

.q-options { margin: 0 0 20px; }
.q-options .opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.q-options .opt {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 14px;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
  transition: border-color .15s, background-color .15s;
}
.q-options .opt.correct { background: #ecfdf5; border-color: #6ee7b7; }
.q-options .lab { font-weight: 700; color: #2563eb; min-width: 22px; }
.q-options .ct { flex: 1; white-space: pre-wrap; color: #1e293b; }
.q-options .mk { font-size: 12px; color: #059669; font-weight: 600; white-space: nowrap; }

.ans {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 3px solid #16a34a;
  border-radius: 10px; padding: 13px 16px; font-size: 15px; white-space: pre-wrap; color: #166534;
}
.ans b { color: #15803d; }
.analysis {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 13px 16px; margin-top: 11px; white-space: pre-wrap; color: #334155;
}
.analysis b { color: #0f172a; }

/* 上一题 / 下一题 */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pg {
  flex: 1; text-align: center; padding: 11px 14px; border-radius: 10px; text-decoration: none;
  font-size: 14px; font-weight: 600; transition: all .15s ease;
}
.pg.prev { background: #fff; color: #2563eb; border: 1px solid #bfdbfe; }
.pg.prev:hover { background: #eff6ff; }
.pg.next { background: #2563eb; color: #fff; border: 1px solid #2563eb; }
.pg.next:hover { background: #1d4ed8; }
.pg.disabled { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; cursor: not-allowed; }

.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- 右侧：相关试题推荐 ---------- */
.side-panel {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 18px;
  position: sticky; top: 76px;
}
.rel-hd {
  font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 12px;
  padding-bottom: 9px; border-bottom: 1px solid #e2e8f0;
}
.rel-hd::before {
  content: ""; display: inline-block; width: 3px; height: 14px; background: #2563eb;
  border-radius: 2px; margin-right: 8px; vertical-align: -2px;
}
.rel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rel-item { padding-bottom: 9px; border-bottom: 1px dashed #e2e8f0; }
.rel-item:last-child { border-bottom: none; padding-bottom: 0; }
.rel-item a {
  display: block; font-size: 13px; line-height: 1.55; color: #334155; text-decoration: none;
  word-break: break-word; padding: 6px 8px; border-radius: 7px;
  transition: background-color .15s, color .15s;
}
.rel-item a::after { content: "›"; float: right; margin-left: 6px; color: #cbd5e1; font-weight: 700; }
.rel-item a:hover { color: #1d4ed8; background: #eff6ff; }
.rel-item a:hover::after { color: #2563eb; }
.rel-empty { font-size: 12px; color: #94a3b8; margin: 0; }

/* ---------- 响应式：平板与移动端上下堆叠 ---------- */
@media (max-width: 900px) {
  .q-layout-wrap { max-width: 820px; }
  .q-layout { grid-template-columns: 1fr; gap: 16px; }
  .q-side { order: 2; }
  .side-panel { position: static; }
  .rel-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .q-layout-wrap { padding: 14px 12px 0; }
  .q-card { padding: 18px 16px; border-radius: 12px; }
  .q-card .q-stem { font-size: 17px; line-height: 1.7; }
  .rel-list { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pg.next { order: -1; }
  .actions .btn { flex: 1; text-align: center; }
}
