/* 题目、思考测验与分步详解浮层 */
.study-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 72px 16px 24px 16px;
  overflow-y: auto;
  background: rgba(241, 245, 249, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.study-container {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 32px;
}

/* 原题卡片 */
.problem-card {
  border-radius: 20px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.problem-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.problem-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}

.score-badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.problem-title {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.problem-statement {
  margin: 0 0 12px 0;
  font-size: 15.5px;
  line-height: 1.75;
  color: #1e293b;
}

.problem-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.problem-hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  flex: 1;
  min-width: 240px;
  line-height: 1.55;
}

/* 标签栏 */
.study-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.study-tab-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.study-tab-btn:hover {
  background: #ffffff;
  color: var(--ink);
}

.study-tab-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* 考一考测验卡片 */
.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-card, .step-card, .challenge-prompt-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

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

.quiz-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

.quiz-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-subtle);
}

.quiz-prompt {
  margin: 0 0 12px 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--ink);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.quiz-opt-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: all 0.15s;
}

.quiz-opt-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.quiz-opt-btn.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.quiz-opt-btn.wrong {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #9f1239;
}

.opt-key {
  font-weight: 800;
  color: var(--blue);
  flex-shrink: 0;
}

.quiz-num-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.quiz-num-input {
  width: 210px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  outline: none;
}

.quiz-num-input:focus {
  border-color: var(--blue);
}

.quiz-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.fb-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.fb-err {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.quiz-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* 按钮 */
.btn-study-primary {
  border: none;
  background: var(--blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-study-primary:hover {
  background: var(--blue-dark);
}

.btn-study-secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-study-secondary:hover {
  background: #f8fafc;
}

.btn-demo-link {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-demo-link:hover {
  background: #dbeafe;
}

/* 分步详解 */
.solution-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.step-title {
  margin: 0 0 4px 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.step-summary {
  margin: 0;
  font-size: 13px;
  color: var(--ink-subtle);
}

.btn-reveal {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-reveal:hover {
  background: #e2e8f0;
}

.step-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}

.step-content p {
  margin: 0 0 8px 0;
}

.formula-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.challenge-dims {
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .study-overlay {
    padding: 96px 10px 20px 10px;
  }
  .problem-card {
    padding: 16px;
  }
  .problem-title {
    font-size: 17px;
  }
}
