:root {
  font-family: "Inter", "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  background-color: #f8fafc;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem;
  min-height: 100vh;
}

.layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 15px 45px rgba(15, 23, 42, 0.1);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.problem-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

textarea,
input[type="file"] {
  font: inherit;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  padding: 0.8rem;
  background: #f8fafc;
}

textarea:focus,
input[type="file"]:focus {
  outline: 2px solid #2563eb;
  background: #fff;
}

.primary {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.primary:hover {
  opacity: 0.9;
}

.hint {
  font-size: 0.85rem;
  color: #475467;
}

.status {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.status.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.status.success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status.info {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-card-header h2 {
  margin: 0;
}

.status-card .status-actions {
  justify-content: flex-end;
}

.page-actions {
  align-self: flex-end;
  justify-content: flex-end;
}

.primary.outline {
  background: transparent;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.primary.outline:hover {
  background: #eff6ff;
  opacity: 1;
}

.results article+article {
  margin-top: 1rem;
}

.steps {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-card {
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 1rem;
  background: #f8fafc;
}

.step-card h4 {
  margin: 0 0 0.5rem;
}

.step-card .mini {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px dashed #cbd5f5;
}

.muted {
  color: #475467;
}

.suggestions {
  padding-left: 1.1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.extra-problems {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.extra-problems li {
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 1rem;
}

.extra-problems p {
  margin: 0.25rem 0;
}

.exam-sheet {
  width: min(100%, 900px);
  margin: 0 auto;
  color: #0f172a;
}

.print-page {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: #fff;
}

@media screen {
  .exam-preview {
    background: #eef2ff;
    padding: 2rem 0 4rem;
  }

  .exam-preview .print-page {
    width: min(100%, 210mm);
    min-height: 297mm;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4e7ec;
    padding: 2rem;
    margin: 0 auto 3rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  }
}

.exam-page {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.exam-page>li {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.75rem 0;
}

.sub-questions {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.exam-page.page-two>li .sub-questions li {
  list-style-type: none;
  margin-left: 0;
  padding-left: 0;
}

.exam-page.page-two>li .sub-questions li::before {
  content: attr(data-label);
  display: inline-block;
  width: 2rem;
  font-weight: 600;
}

.recognized-text p {
  margin: 0 0 0.75rem;
}

.no-print {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .no-print {
    display: none;
  }

  .exam-sheet {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    background: #fff;
    padding: 0;
  }

  .print-page {
    page-break-after: always;
    border: none;
    border-radius: 0;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: auto;
    box-shadow: none;
  }

  .print-page:last-child {
    page-break-after: auto;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .card {
    padding: 1.25rem;
  }
}
