/* ============================================
   问答页样式 - Quiz (大厅 + 答题)
   ============================================ */

.quiz-card {
  max-width: 720px;
  margin: 0 auto;
  min-height: 400px;
  padding: 1.75rem;
}

/* 加载 */
#quiz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--color-text-light);
  font-size: 1.05rem;
  text-align: center;
}

/* ============================================
   大厅 - 套题选择
   ============================================ */
.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.lobby-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  border: 1px solid rgba(226, 236, 226, 0.5);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lobby-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lobby-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.lobby-card:hover::before {
  opacity: 1;
}

.lobby-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-card-icon svg {
  width: 100%;
  height: 100%;
}

.lobby-card:hover .lobby-card-icon {
  color: var(--color-primary-dark);
}

.lobby-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.6rem;
}

.lobby-card-desc {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
}

.lobby-card-count {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(44, 125, 160, 0.07);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.lobby-card-share {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  z-index: 2;
}

.lobby-card:hover .lobby-card-share,
.lobby-card-share:hover {
  opacity: 1;
}

.lobby-card-share:hover {
  background: var(--color-primary);
  color: white;
}

@media (hover: none) {
  .lobby-card-share {
    opacity: 0.65;
  }
}

/* Toast 提示 */
.quiz-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary-dark);
  color: white;
  padding: 0.7rem 1.6rem;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.quiz-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   答题区 - 分类标签
   ============================================ */
.quiz-category-label {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

/* 进度条 */
.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 1.8rem;
}

/* 图片区 */
#quiz-image-wrap {
  text-align: center;
  margin-bottom: 1.5rem;
}

#quiz-image-list {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.quiz-img-single {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  object-fit: contain;
}

.quiz-img-compare {
  max-width: calc(50% - 0.5rem);
  max-height: 280px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  object-fit: contain;
  flex-shrink: 0;
}

/* 题目 */
.quiz-question {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.8rem;
  text-align: center;
  color: var(--color-text);
}

/* 选项 */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--color-surface);
  transition: all 0.2s ease;
  font-size: 1.02rem;
  color: var(--color-text);
  user-select: none;
}

.quiz-option:hover {
  border-color: var(--color-primary);
  background: rgba(44, 125, 160, 0.04);
  transform: translateX(4px);
}

.quiz-option .option-letter {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quiz-option:hover .option-letter {
  background: var(--color-primary);
  color: white;
}

.quiz-option.correct {
  border-color: var(--color-success) !important;
  background: rgba(76, 175, 80, 0.08) !important;
  animation: pulseCorrect 0.4s ease;
}

.quiz-option.correct .option-letter {
  background: var(--color-success) !important;
  color: white !important;
}

.quiz-option.wrong {
  border-color: var(--color-error) !important;
  background: rgba(229, 57, 53, 0.06) !important;
  animation: shake 0.4s ease;
}

.quiz-option.wrong .option-letter {
  background: var(--color-error) !important;
  color: white !important;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.quiz-option.disabled.correct {
  opacity: 1;
}

@keyframes pulseCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* 反馈区 */
.quiz-feedback {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.6;
  animation: fadeInUp 0.35s ease both;
}

.quiz-feedback.correct-fb {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.25);
  color: var(--color-success-text);
}

.quiz-feedback.wrong-fb {
  background: rgba(229, 57, 53, 0.06);
  border: 1px solid rgba(229, 57, 53, 0.2);
  color: var(--color-error-text);
}

/* 答题导航按钮 */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}
/* 结果页 */
#quiz-result {
  text-align: center;
  padding: 1.5rem 0;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 第一阶段：分数揭示 */
.result-reveal {
  cursor: pointer;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 0.8rem;
  animation: resultBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.result-score-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.result-score-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1;
  animation: resultScorePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.result-score-total {
  font-size: 1.3rem;
  color: var(--color-text-light);
  font-weight: 500;
  animation: fadeInUp 0.5s ease 0.3s both;
}

.result-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: 2.2rem;
  animation: fadeInUp 0.5s ease 0.4s both;
}

.result-hint {
  font-size: 0.85rem;
  color: var(--color-primary);
  opacity: 0;
  animation: fadeInUp 0.5s ease 0.7s both, hintPulse 2s ease 1.4s infinite;
}

@keyframes resultBounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes resultScorePop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 第二阶段：复盘详情 */
.result-detail-wrap {
  animation: fadeInUp 0.5s ease both;
}

.result-detail {
  text-align: left;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-detail::-webkit-scrollbar {
  width: 5px;
}

.result-detail::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}

.result-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  font-size: 0.93rem;
  line-height: 1.5;
  animation: fadeInUp 0.4s ease both;
}

.result-item.correct-item {
  border-left: 4px solid var(--color-success);
  background: rgba(76, 175, 80, 0.04);
}

.result-item.wrong-item {
  border-left: 4px solid var(--color-error);
  background: rgba(229, 57, 53, 0.03);
}

.result-item .ri-q {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.result-item .ri-a {
  color: var(--color-text-light);
  font-size: 0.88rem;
}

.result-item .ri-explain {
  margin-top: 0.4rem;
  color: var(--color-text-light);
  font-size: 0.85rem;
  font-style: italic;
}

.result-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 768px) {
  .lobby-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 480px) {
  .quiz-card {
    padding: 1.5rem 1rem;
  }

  .lobby-card {
    padding: 1.5rem 1.25rem;
  }

  .lobby-card-icon {
    width: 44px;
    height: 44px;
  }

  .quiz-question {
    font-size: 1.12rem;
  }

  .quiz-option {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .result-score-num {
    font-size: 2.6rem;
  }

  .result-buttons {
    flex-direction: column;
    align-items: center;
  }
}
