/* 练习页：左目录（学科/学段/年级/领域 + 章节题量），右答题区。窄屏上下堆叠。 */

body.page-practice {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.practice {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
}
.practice-mobile-bar { display: none; }

.side, .pane { min-width: 0; min-height: 0; }

.side {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  max-height: calc(100dvh - 96px);
}
.side-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.side-tools input, .side-tools select { width: 100%; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.subj-tabs { gap: 6px; }
.side .stage-tabs { gap: 6px; }
.side .stage-tab { padding: 3px 10px; min-height: 32px; font-size: 0.86rem; }
.count { color: var(--muted); font-size: 0.92rem; font-weight: 650; }
.list { overflow: auto; flex: 1; padding-bottom: 16px; }
.pad12 { padding: 12px; }

.scope-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 10px 8px 6px;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
}
.scope-all-name { font-weight: 800; }
.scope-all.sel { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }

.vol > summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.chap-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 2px 8px;
  padding: 9px 10px;
  min-height: 42px;
  text-align: left;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}
.chap-item:hover { background: var(--bg-muted); }
.chap-item.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); font-weight: 800; }
.chap-name { min-width: 0; overflow-wrap: anywhere; }
.count-pill { flex: none; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.chap-item.sel .count-pill { color: var(--brand-strong); }

.pane {
  overflow: auto;
  background: var(--bg);
  padding: 18px 18px 40px;
  max-height: calc(100dvh - 96px);
}
.pane-inner { max-width: 880px; margin: 0 auto; }

.p-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.p-title { margin: 0 0 8px; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.02em; }
.p-sub { margin: 0 0 8px; font-size: 1rem; }
.p-lede { margin: 0 0 14px; color: var(--muted); }
.p-note { margin: 10px 0 0; color: var(--muted); font-size: 0.92rem; }
.p-warn { margin: 10px 0 0; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.p-bad { margin: 10px 0; color: var(--bad); font-weight: 700; }
.p-good { margin: 10px 0 0; background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 10px 12px; font-weight: 700; }

.p-field { margin: 0 0 14px; }
.p-label { display: block; color: var(--muted); font-size: 0.86rem; font-weight: 800; margin-bottom: 6px; }
.p-types { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.p-check { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; min-height: 32px; }
.p-count-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.p-num { width: 92px; min-height: 40px; }
.p-chip { min-height: 34px; padding: 4px 12px; border-radius: 999px; }

.p-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.p-actions .btn { text-decoration: none; }

.p-list { margin: 0; padding-left: 1.2em; color: var(--muted); line-height: 1.9; }

/* 作答 */
.p-progress { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.p-progress-text { font-size: 0.95rem; }
.p-progress-bars { position: relative; flex: 1 1 160px; height: 6px; min-width: 120px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.p-progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 999px; transition: width 0.2s ease; }

.p-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.p-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 1px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 0.8rem; font-weight: 800; }
.p-tag-soft { background: var(--bg-muted); color: var(--muted); }
.p-kp { color: var(--muted); font-size: 0.88rem; font-weight: 650; }
.p-prompt { font-size: 1.12rem; line-height: 1.7; margin: 6px 0 16px; overflow-wrap: anywhere; }

.p-choices { display: flex; flex-direction: column; gap: 8px; }
.p-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.p-choice:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.p-key { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--bg-muted); font-weight: 800; font-size: 0.9rem; }
.p-choice-text { min-width: 0; }
.p-choice.right { border-color: var(--ok); background: var(--ok-bg); }
.p-choice.right .p-key { background: var(--ok); color: var(--on-ok); }
.p-choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.p-choice.wrong .p-key { background: var(--bad); color: var(--on-bad); }

.p-input-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p-input { flex: 1 1 220px; min-height: 46px; }
.p-skip { margin-top: 10px; background: transparent; border: none; color: var(--muted); text-decoration: underline; padding: 6px 0; min-height: 32px; }
.p-skip:hover { background: transparent; color: var(--text); }

.p-open { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.p-answer-box { background: var(--bg-muted); border-radius: 12px; padding: 12px; width: 100%; }
.p-answer-line { margin: 0 0 6px; font-weight: 700; overflow-wrap: anywhere; }

.p-feedback { margin-top: 16px; border-radius: 12px; padding: 12px 14px; }
.p-feedback.ok { background: var(--ok-bg); }
.p-feedback.bad { background: var(--bad-bg); }
.p-fb-title { margin: 0 0 6px; font-weight: 800; }
.p-feedback.ok .p-fb-title { color: var(--ok); }
.p-feedback.bad .p-fb-title { color: var(--bad); }
.p-fb-line { margin: 4px 0; overflow-wrap: anywhere; }
.p-fb-saved { color: var(--muted); font-weight: 650; }

.p-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.p-stat { background: var(--bg-muted); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.p-stat strong { display: block; font-size: 1.4rem; line-height: 1.2; }
.p-stat .muted { font-size: 0.82rem; font-weight: 650; }

@media (max-width: 900px) {
  body.page-practice { height: auto; }
  .practice { display: flex; flex-direction: column; }
  .practice-mobile-bar { display: block; padding: 10px 12px 0; }
  .list-toggle { width: 100%; }
  .side-collapse { display: none; }
  .side { display: none; border-right: none; max-height: none; border-bottom: 1px solid var(--line); }
  .side.open { display: flex; max-height: 58vh; }
  .pane { padding: 12px 12px 32px; max-height: none; }
  .p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-card { padding: 14px; }
}

@media (min-width: 901px) {
  .practice.side-collapsed { grid-template-columns: minmax(0, 1fr); }
  .practice.side-collapsed .side { display: none; }
}

@media print {
  .side, .practice-mobile-bar, .site-header, .site-footer, .p-actions { display: none !important; }
  .pane { max-height: none; overflow: visible; padding: 0; }
  body.page-practice { display: block; }
}
