* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f7f7;
  color: #111;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 28px;
  background: #fcfcfc;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
}

.title {
  margin: 0 0 28px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: "Times New Roman", Times, serif;
}

.instruction {
  max-width: 760px;
  margin: -8px auto 22px;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.96rem;
  line-height: 1.7;
  color: #555;
}

.question-card {
  background: #ffffff;
  padding: 4px 0 0;
}

.paragraph {
  font-size: 1.05rem;
  line-height: 2.05;
  max-width: 980px;
  margin: 0 auto;
  word-break: normal;
}

.blank-wrap {
  display: inline-flex;
  align-items: baseline;
  vertical-align: baseline;
  margin: 0 1px;
}

.blank-prefix {
  white-space: pre;
  line-height: 1;
}

.blank-box {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  background: #d9d9d9;
  border-radius: 2px;
  padding: 1px 4px;
}

.blank-box.correct {
  background: #d8f0da;
}

.blank-box.incorrect {
  background: #f5d3d3;
}

.blank-box.revealed {
  background: #d7e7ff;
}

.blank-box.locked {
  opacity: 0.7;
}

.blank-display,
.blank-input {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92em;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.blank-display {
  display: inline-block;
  color: #666;
  white-space: pre;
  user-select: none;
}

.blank-input {
  position: absolute;
  inset: 1px 4px;
  width: calc(100% - 8px);
  height: calc(100% - 2px);
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: #111;
  padding: 0;
  margin: 0;
}

.blank-input:disabled {
  cursor: not-allowed;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 1px solid #bdbdbd;
  background: #fff;
  color: #111;
  padding: 10px 18px;
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: #f0f0f0;
}

.btn.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}

.btn.primary:hover {
  background: #2a2a2a;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #dcdcdc;
  color: #666;
  border-color: #c7c7c7;
}

.btn.primary:disabled {
  background: #bdbdbd;
  color: #666;
  border-color: #bdbdbd;
}

.result-area {
  text-align: center;
  margin-top: 16px;
  min-height: 0;
}

.score {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.feedback {
  margin: 0;
  color: #444;
}

.answer-preview {
  max-width: 980px;
  margin: 18px auto 0;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  text-align: left;
  line-height: 2;
}

.answer-preview-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}

.answer-preview-text {
  margin: 0;
}

.answer-highlight {
  background: #fff1a8;
  padding: 1px 2px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .page {
    padding: 24px 16px 28px;
  }

  .title {
    font-size: 1.25rem;
    margin-bottom: 22px;
  }

  .instruction {
    max-width: 92%;
    margin: -6px auto 20px;
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .paragraph {
    font-size: 1rem;
    line-height: 2.15;
  }

  .blank-display,
  .blank-input {
    font-size: 0.96em;
  }

  .answer-preview {
    padding: 16px 14px;
    line-height: 1.9;
  }
}