/* ===== 刷题记录页面 ===== */

#page-quiz-history.active {
  z-index: 50;
}

.qh-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f6f8fb;
}

.qh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(var(--safe-top, 0px) + 8px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border-bottom: 1px solid rgba(219, 226, 236, 0.8);
  flex-shrink: 0;
}

.qh-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 122, 255, 0.08);
  color: #007aff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qh-back:active {
  background: rgba(0, 122, 255, 0.15);
}

.qh-title {
  font-size: 17px;
  font-weight: 700;
  color: #14213d;
}

.qh-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

/* 加载状态 */
.qh-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #8f96a3;
  font-size: 15px;
}

.qh-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e9edf3;
  border-top-color: #2f6bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.qh-retry-btn {
  margin-top: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f6bff, #5a8fff);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 概览统计 */
.qh-overview {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.qh-overview-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(219, 226, 236, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.qh-overview-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.qh-overview-num {
  font-size: 28px;
  font-weight: 800;
  color: #14213d;
  line-height: 1.1;
}

.qh-overview-label {
  font-size: 12px;
  color: #8f96a3;
  margin-top: 4px;
}

/* 区块 */
.qh-section {
  margin-bottom: 24px;
}

.qh-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #14213d;
  margin-bottom: 12px;
}

/* 趋势图 */
.qh-chart-wrap {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(219, 226, 236, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.qh-chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.qh-chart-scroll::-webkit-scrollbar {
  display: none;
}

.qh-chart-empty {
  text-align: center;
  color: #8f96a3;
  padding: 40px 0;
  font-size: 14px;
}

/* 模块分析 */
.qh-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qh-module-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(219, 226, 236, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.qh-module-name {
  font-size: 14px;
  font-weight: 600;
  color: #14213d;
  margin-bottom: 10px;
}

.qh-module-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.qh-module-bar {
  flex: 1;
  height: 8px;
  background: #e9edf3;
  border-radius: 4px;
  overflow: hidden;
}

.qh-module-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.qh-module-accuracy {
  font-size: 18px;
  font-weight: 800;
  min-width: 50px;
  text-align: right;
}

.qh-module-count {
  font-size: 12px;
  color: #8f96a3;
}

.qh-module-empty {
  text-align: center;
  color: #8f96a3;
  padding: 20px;
  font-size: 14px;
}

/* 错题列表 */
.qh-wrong-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qh-wrong-module-group {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(219, 226, 236, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.qh-wrong-module-title {
  font-size: 15px;
  font-weight: 700;
  color: #14213d;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(219, 226, 236, 0.6);
}

.qh-wrong-module-group .qh-wrong-card {
  background: #f6f8fb;
  border: none;
  box-shadow: none;
  margin-bottom: 8px;
}

.qh-wrong-module-group .qh-wrong-card:last-child {
  margin-bottom: 0;
}

.qh-wrong-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(219, 226, 236, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.2s;
}

.qh-wrong-card:active {
  transform: scale(0.98);
}

.qh-wrong-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.qh-wrong-module {
  font-size: 12px;
  font-weight: 600;
  color: #2f6bff;
  background: rgba(47, 107, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
}

.qh-wrong-count {
  font-size: 12px;
  font-weight: 600;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
}

.qh-wrong-stem {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qh-wrong-answer {
  font-size: 13px;
  color: #34c759;
}

.qh-wrong-answer b {
  color: #34c759;
  font-weight: 700;
}

.qh-wrong-empty {
  text-align: center;
  color: #8f96a3;
  padding: 30px 0;
  font-size: 14px;
}

.qh-loading-sm {
  text-align: center;
  color: #8f96a3;
  padding: 20px;
  font-size: 13px;
}

/* ===== 错题详情弹窗 ===== */
.qh-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.qh-detail-overlay.show {
  background: rgba(0, 0, 0, 0.45);
}

.qh-detail-modal {
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.qh-detail-overlay.show .qh-detail-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.qh-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #e9edf3;
  flex-shrink: 0;
}

.qh-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: #14213d;
}

.qh-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f2f4f7;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qh-detail-close:active {
  background: #e5e7eb;
}

.qh-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.qh-detail-module {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #2f6bff;
  background: rgba(47, 107, 255, 0.1);
  padding: 5px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.qh-detail-stem {
  font-size: 16px;
  color: #222;
  line-height: 1.7;
  margin-bottom: 16px;
}

.qh-detail-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.qh-detail-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e8ecf2;
  background: #fff;
}

.qh-detail-option.correct {
  border-color: #34c759;
  background: #eaf8ef;
}

.qh-detail-option.wrong {
  border-color: #ff3b30;
  background: #fff0ee;
}

.qh-detail-opt-label {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
}

.qh-detail-option.correct .qh-detail-opt-label {
  background: #34c759;
  color: #fff;
}

.qh-detail-option.wrong .qh-detail-opt-label {
  background: #ff3b30;
  color: #fff;
}

.qh-detail-opt-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.qh-detail-opt-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.qh-detail-opt-tag.correct {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.qh-detail-opt-tag.wrong {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}

.qh-detail-answers {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qh-detail-ans-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f6f8fb;
}

.qh-detail-ans-label {
  font-size: 12px;
  color: #8f96a3;
  min-width: 56px;
}

.qh-detail-ans-value {
  font-size: 15px;
  font-weight: 700;
}

.qh-detail-ans-value.correct {
  color: #34c759;
}

.qh-detail-ans-value.wrong {
  color: #ff3b30;
}

.qh-detail-explain {
  background: #f6f8fb;
  border-radius: 14px;
  padding: 14px;
}

.qh-detail-explain-title {
  font-size: 13px;
  font-weight: 700;
  color: #2f6bff;
  margin-bottom: 8px;
}

.qh-detail-explain-text {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}
