:root {
  --ink: #111418;
  --muted: #647071;
  --line: #dbe3de;
  --paper: #faf7ef;
  --panel: #ffffff;
  --brand: #0f6f5f;
  --brand-dark: #0a4a41;
  --danger: #b8332a;
  --ok: #17794f;
  --shadow: 0 14px 34px rgba(17, 24, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.exam-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffaf0 0%, #f3efe4 100%);
}

.screen {
  display: none;
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.screen-active {
  display: block;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--brand-dark);
  font-size: 14px;
}

.brand-mark {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 86px;
  max-width: 38vw;
  height: auto;
}

.brand-bar strong {
  line-height: 1;
}

.hero {
  padding: 44px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.summary {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.profile-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #2e3839;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 13px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input[readonly] {
  color: #3d4848;
  background: #f8faf7;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 111, 95, 0.14);
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.55;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-button,
.secondary-button,
.submit-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.submit-button {
  background: var(--brand);
  color: #fff;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 16px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-dark);
}

.submit-button {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
}

.identity-card,
.assigned-exam {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.identity-status {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 900;
}

.identity-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.assigned-exam h2 {
  margin-bottom: 8px;
}

.role-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.role-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(219, 227, 222, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.role-item strong {
  color: var(--ink);
}

.role-item-selectable {
  cursor: pointer;
}

.role-item-selectable:hover,
.role-item-selected {
  border-color: rgba(15, 111, 95, 0.52);
  background: rgba(15, 111, 95, 0.08);
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: #fff;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.exam-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8ded8;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.2s ease;
}

.option-list {
  display: grid;
  gap: 12px;
}

.choice-tip {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.option-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
}

.option-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  background: #edf3ef;
  color: var(--brand-dark);
}

.option-button-selected {
  border-color: var(--brand);
  background: #eaf5f0;
}

.essay-answer {
  display: grid;
  gap: 10px;
}

.essay-answer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.question-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.result-card {
  margin-top: 34px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.score-line {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.result-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.score-line span {
  font-size: 40px;
  font-weight: 900;
}

.score-line small {
  color: var(--muted);
  font-weight: 700;
}

.result-reason {
  color: var(--muted);
  line-height: 1.6;
}

.submit-status {
  margin-bottom: 12px;
  font-weight: 800;
}

.result-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.wrong-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.wrong-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wrong-item-redline {
  border-color: rgba(184, 51, 42, 0.45);
}

.wrong-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.wrong-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pass {
  color: var(--ok);
}

.fail {
  color: var(--danger);
}

@media (min-width: 720px) {
  .screen {
    padding-inline: 34px;
  }
}
