body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 20px;
}

.topbar {
  margin-bottom: 10px;
}

.back-link {
  display: inline-block;
  text-decoration: none;
  color: #2563eb;
  font-weight: 700;
}

.back-link:hover {
  text-decoration: underline;
}

h1 {
  text-align: center;
  margin: 12px 0 26px;
  font-size: 2.1rem;
}

.exam-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.exam-progress {
  font-size: 16px;
  font-weight: 800;
  color: #334155;
}

.exam-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timer {
  min-width: 86px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
  background: #eef4ff;
  border-radius: 12px;
  padding: 10px 14px;
}

.nav-btn {
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn {
  background: #2563eb;
  color: white;
}

.secondary-btn {
  background: #e5e7eb;
  color: #111827;
}

.submit-btn {
  background: #111827;
  color: white;
}

.question-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.speaker-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
}

.speaker-row:last-child {
  margin-bottom: 0;
}

.avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #d9f3ef;
  border: 3px solid #12a594;
  flex-shrink: 0;
}

.speech,
.response-area {
  font-size: 20px;
  line-height: 1.8;
  flex: 1;
}

.speech {
  font-weight: 700;
}

.response-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 0;
}

.fixed-text {
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}

.slot {
  min-width: 92px;
  height: 34px;
  border-bottom: 3px solid #cfcfcf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-right: 6px;
  background: transparent;
  transition: background 0.15s ease;
}

.slot.over {
  background: #eef9f7;
  border-radius: 6px 6px 0 0;
}

.token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ccc;
  cursor: grab;
  user-select: none;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.bank {
  min-height: 92px;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.controls {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  padding: 10px 18px;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

#resetBtn {
  background: #ddd;
}

.result {
  margin-top: 16px;
  font-size: 15px;
  min-height: 22px;
  color: #64748b;
}

.final-result {
  margin-top: 24px;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.final-result.hidden {
  display: none;
}

.final-score {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.final-accuracy {
  font-size: 16px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 20px;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #fcfdff;
}

.review-item.correct {
  border-left: 6px solid #16a34a;
}

.review-item.wrong {
  border-left: 6px solid #dc2626;
}

.review-title {
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.5;
}

.review-line {
  margin: 4px 0;
  line-height: 1.6;
}

.review-line strong {
  color: #111827;
}

/* Writing 页 Set 布局 */
.bs-set-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bs-set-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

.bs-set-title {
  width: 62px;
  flex: 0 0 62px;
  font-size: 16px;
  font-weight: 800;
  color: #222;
}

.bs-grid {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.bs-item {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ccc;
  font-weight: 800;
  text-decoration: none;
  color: #333;
  transition: 0.16s ease;
  flex: 0 0 42px;
}

.bs-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.bs-item.correct {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.bs-item.wrong {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.bs-set-score {
  margin-left: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .container {
    padding: 14px;
  }

  h1 {
    font-size: 1.7rem;
    margin-bottom: 20px;
  }

  .question-card {
    padding: 18px;
    border-radius: 16px;
  }

  .speaker-row {
    gap: 12px;
    margin-bottom: 20px;
  }

  .avatar {
    width: 58px;
    height: 58px;
  }

  .speech,
  .response-area {
    font-size: 18px;
    line-height: 1.75;
  }

  .slot {
    min-width: 82px;
    height: 30px;
  }

  .token {
    font-size: 15px;
    padding: 6px 10px;
  }

  .bank {
    padding: 16px;
    border-radius: 16px;
  }

  .bs-set-row {
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .bs-grid {
    gap: 10px;
  }

  .bs-item {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}
