:root {
  color-scheme: light;
  --ink: #122234;
  --muted: #607184;
  --line: #d7e0e8;
  --paper: #ffffff;
  --soft: #f3f7f8;
  --navy: #17324d;
  --teal: #087b75;
  --teal-dark: #055e59;
  --amber: #c57618;
  --red: #b43a3a;
  --green: #147a4a;
  --shadow: 0 12px 32px rgba(18, 34, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf3f5;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  min-height: 72px;
  padding: 12px max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: var(--navy);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  color: #b8c9d7;
  font-size: 12px;
}

.task-meta {
  text-align: right;
}

.task-meta span,
.task-meta strong {
  display: block;
}

.task-meta span {
  color: #b8c9d7;
  font-size: 12px;
}

.task-meta strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.task-intro {
  padding: 42px 48px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  align-items: start;
  gap: 48px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.18;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.3;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: #465a6d;
  font-size: 17px;
}

.evidence-box {
  padding: 22px;
  border-left: 4px solid var(--amber);
  background: #fff8ec;
}

.evidence-box strong {
  display: block;
  margin-bottom: 7px;
}

.evidence-box p {
  margin: 0;
  color: #6a543a;
  font-size: 14px;
}

.source-band,
.retest-band {
  padding: 24px 48px;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  background: #e7f2f1;
}

.source-band h2,
.source-band p,
.retest-band h2,
.retest-band p {
  margin-bottom: 0;
}

.source-band p,
.retest-band p {
  color: #476160;
}

.source-band ul {
  margin: 0;
  padding-left: 20px;
}

.source-band code {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.role-outcomes {
  padding: 30px 48px;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.role-outcomes-head h2,
.role-outcomes-head p {
  margin-bottom: 0;
}

.role-outcomes-head > p:last-child {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.outcome-grid div {
  min-width: 0;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
}

.outcome-grid div:last-child {
  border-right: 0;
}

.outcome-grid strong,
.outcome-grid span {
  display: block;
}

.outcome-grid strong {
  margin-bottom: 6px;
  color: var(--amber);
  font-size: 15px;
}

.outcome-grid span {
  color: #496072;
  font-size: 13px;
}

.lifecycle-status {
  min-height: 58px;
  padding: 12px 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #b8d7d3;
  color: #315653;
  background: #e8f4f2;
}

.lifecycle-status strong {
  flex: 0 0 auto;
}

.lifecycle-status span {
  min-width: 0;
  color: #58716f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.lifecycle-status[data-status="hold"] {
  border-bottom-color: #e3c58c;
  color: #76531c;
  background: #fff5e2;
}

.lifecycle-status[data-status="qualified"] {
  border-bottom-color: #9dcdb3;
  color: var(--green);
  background: #edf8f2;
}

.lifecycle-status[data-status="not_selected"] {
  border-bottom-color: #e1b3b3;
  color: var(--red);
  background: #fff1f1;
}

.stage-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.stage-nav a {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  color: #4b6072;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.stage-nav a:hover,
.stage-nav a:focus-visible {
  border-bottom-color: var(--teal);
  color: var(--teal-dark);
}

.stage-nav span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
}

.task-section {
  padding: 42px 48px 48px;
  scroll-margin-top: 64px;
  border-bottom: 1px solid var(--line);
}

.muted-section {
  background: var(--soft);
}

.section-head {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: 36px;
}

.section-head h2,
.section-head p {
  margin-bottom: 0;
}

.section-head > p {
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

label {
  min-width: 0;
  display: block;
}

label > span,
.file-field > span {
  display: block;
  margin-bottom: 7px;
  color: #31485d;
  font-size: 14px;
  font-weight: 700;
}

label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #b9c7d2;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

input {
  min-height: 44px;
  padding: 9px 11px;
}

select {
  min-height: 44px;
  padding: 9px 34px 9px 11px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 123, 117, 0.14);
}

input:disabled,
textarea:disabled,
select:disabled {
  color: #657484;
  background: #eef2f4;
}

.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.check-row span {
  margin: 0;
  font-weight: 400;
}

.requirements-confirm {
  padding: 18px;
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  background: #f7fafb;
}

.requirements-confirm > span {
  margin: 0;
  color: var(--ink);
}

.requirements-confirm label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.requirements-confirm input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.requirements-confirm label span {
  margin: 0;
  color: #41596c;
  font-weight: 400;
}

.requirements-confirm label strong {
  color: var(--navy);
}

.form-actions {
  min-height: 46px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  color: #fff;
  background: var(--teal);
}

.button.primary:hover:not(:disabled),
.button.primary:focus-visible {
  background: var(--teal-dark);
}

.button.secondary {
  border-color: #aabac7;
  color: var(--navy);
  background: #fff;
}

.button.secondary:hover:not(:disabled),
.button.secondary:focus-visible {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.button.compact {
  min-height: 38px;
  padding: 7px 12px;
}

.form-message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-message.success {
  color: var(--green);
}

.form-message.error {
  color: var(--red);
}

.receipt {
  margin-top: 24px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #9ecdc7;
  border-left: 4px solid var(--teal);
  background: #eff9f7;
}

.receipt span,
.receipt strong {
  display: block;
}

.receipt span {
  color: var(--muted);
  font-size: 12px;
}

.receipt strong {
  overflow-wrap: anywhere;
}

.receipt p {
  max-width: 620px;
  margin: 0;
  color: #496363;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.question-list {
  display: grid;
  gap: 18px;
}

.question-list label {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.question-list label:last-of-type {
  border-bottom: 0;
}

.question-list strong,
.question-list label > span {
  display: block;
}

.question-list strong {
  margin-bottom: 4px;
  font-size: 16px;
}

.question-list label > span {
  margin-bottom: 9px;
  color: var(--muted);
  font-weight: 400;
}

.file-field {
  padding: 16px;
  border: 1px dashed #9bafbd !important;
  background: #fff;
}

.file-field input {
  min-height: 42px;
  padding: 6px;
}

.challenge-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rules-strip {
  margin: 24px 0 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.rules-strip div {
  min-width: 0;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
}

.rules-strip div:last-child {
  border-right: 0;
}

.rules-strip strong,
.rules-strip span {
  display: block;
}

.rules-strip strong {
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 13px;
}

.rules-strip span {
  color: var(--muted);
  font-size: 13px;
}

.final-form {
  padding-top: 8px;
}

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

.assignment-item {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  background: #fff;
}

.assignment-item[data-status="submitted"],
.assignment-item[data-status="passed"] {
  border-left-color: var(--green);
}

.assignment-item[data-status="failed"],
.assignment-item[data-status="needs_improvement"] {
  border-left-color: var(--red);
}

.assignment-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.assignment-item h3,
.follow-up-form h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.assignment-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.status-tag {
  min-width: 74px;
  padding: 3px 8px;
  flex: 0 0 auto;
  border: 1px solid #b7c7d2;
  color: #486072;
  background: #f5f8fa;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.assignment-details {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}

.assignment-details div {
  min-width: 0;
}

.assignment-details dt {
  color: #345064;
  font-size: 12px;
  font-weight: 800;
}

.assignment-details dd {
  margin: 2px 0 0;
  color: #526779;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.follow-up-form {
  margin-top: 24px;
  padding: 24px;
  border-top: 3px solid var(--navy);
  background: var(--soft);
}

.empty-copy {
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed #a9bac6;
  color: var(--muted);
  background: #f8fafb;
}

.timeline-section {
  background: #fbfcfd;
}

.fulfillment-summary {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 4px solid #9aabba;
  background: #edf2f5;
  color: #52677a;
}

.fulfillment-summary.on-time {
  border-left-color: var(--green);
  background: #edf8f2;
  color: var(--green);
}

.fulfillment-summary.late {
  border-left-color: var(--red);
  background: #fff0f0;
  color: var(--red);
}

.event-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-timeline li {
  position: relative;
  min-height: 64px;
  padding: 8px 0 16px 34px;
  border-left: 2px solid #c8d4dc;
}

.event-timeline li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}

.event-timeline li.empty {
  min-height: auto;
  padding-left: 0;
  border-left: 0;
  color: var(--muted);
}

.event-timeline li.empty::before {
  display: none;
}

.event-timeline strong,
.event-timeline span,
.event-timeline code {
  display: block;
}

.event-timeline span {
  color: var(--muted);
  font-size: 13px;
}

.event-timeline code {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #3d5c70;
  font-size: 12px;
}

.retest-band {
  background: #fff4e5;
}

.retest-band p {
  color: #705a3e;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #647585;
  font-size: 13px;
}

@media (max-width: 820px) {
  .topbar {
    padding-inline: 18px;
  }

  .task-meta {
    display: none;
  }

  main {
    width: 100%;
    margin-top: 0;
    box-shadow: none;
  }

  .task-intro,
  .source-band,
  .retest-band,
  .role-outcomes,
  .section-head {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .task-intro,
  .task-section,
  .source-band,
  .retest-band,
  .role-outcomes {
    padding-inline: 22px;
  }

  .stage-nav {
    padding: 0 8px;
    grid-template-columns: repeat(7, minmax(88px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .stage-nav a {
    min-height: 58px;
    gap: 4px;
    font-size: 11px;
    text-align: center;
  }

  .stage-nav span {
    display: none;
  }

  .form-grid,
  .rules-strip,
  .outcome-grid,
  .assignment-details {
    grid-template-columns: 1fr;
  }

  .rules-strip div,
  .rules-strip div:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .outcome-grid div,
  .outcome-grid div:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .outcome-grid div:last-child {
    border-bottom: 0;
  }

  .lifecycle-status {
    padding-inline: 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .assignment-item-head {
    flex-direction: column;
    gap: 8px;
  }

  .rules-strip div:last-child {
    border-bottom: 0;
  }

  .full {
    grid-column: auto;
  }

  .receipt,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    width: calc(100% - 40px);
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 21px;
  }

  .task-intro {
    padding-top: 30px;
  }

  .task-section {
    padding-block: 34px;
  }

  .button {
    width: 100%;
  }

  .challenge-toolbar,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
