:root {
  --navy: #122d49;
  --blue: #1775d1;
  --blue-soft: #eaf4ff;
  --orange: #f5a524;
  --green: #148454;
  --paper: #fff;
  --line: #dfe8f1;
  --muted: #6a7c90;
  --bg: #f3f7fb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font:
    15px/1.6 "Microsoft YaHei",
    system-ui,
    sans-serif;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input {
  font: inherit;
}
.site-header {
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-right: 8px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}
.site-header .header-note {
  color: var(--muted);
  font-size: 13px;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 24px;
}
.hero-card,
.form-card,
.outcome-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7eef6;
  border-radius: 20px;
  box-shadow: 0 16px 42px #163b6214;
}
.hero-card {
  min-height: 500px;
  padding: 54px 48% 52px 62px;
  background: #fff url("/assets/construction-safety-hero.webp") right 28px
    bottom/430px auto no-repeat;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hero-card h1,
.form-card h1,
.outcome-card h1 {
  margin: 0;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.3;
}
.hero-card h1 span {
  display: block;
  color: var(--blue);
}
.hero-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
}
.rule-list {
  margin: 30px 0;
  display: grid;
  gap: 10px;
}
.rule-list div {
  display: flex;
  justify-content: space-between;
  padding: 10px 13px;
  background: #f7faff;
  border-radius: 8px;
}
.rule-list span {
  color: var(--muted);
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover {
  background: #1066bb;
}
.btn.secondary {
  background: #fff;
  border-color: #cbd9e7;
  color: #315470;
}
.btn.warning {
  background: var(--orange);
}
.text-link {
  display: inline-block;
  margin: 15px 0;
}
.form-wrap,
.outcome-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 36px 24px;
}
.form-card,
.outcome-card {
  width: min(560px, 100%);
  padding: 42px;
}
.form-card h1,
.outcome-card h1 {
  text-align: center;
  font-size: 28px;
}
.form-card .lead,
.outcome-card .lead {
  text-align: center;
  color: var(--muted);
  margin: 12px 0 28px;
}
.field {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}
.field label {
  font-weight: 700;
}
.field input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #1775d11c;
}
.form-card .btn {
  width: 100%;
  margin-top: 10px;
}
.notice {
  min-height: 24px;
  color: #ba301c;
  margin: 14px 0 0;
}
.notice.success {
  color: var(--green);
}
.practice-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.practice-header .mode {
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}
.practice-header .person {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.practice-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 20px;
}
.answer-card,
.question-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.answer-card {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 20px;
}
.answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.answer-head strong {
  font-size: 17px;
}
.progressbar {
  height: 8px;
  margin: 14px 0 8px;
  background: #e8eff6;
  border-radius: 99px;
  overflow: hidden;
}
.progressbar span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 0.2s;
}
.answer-summary {
  color: var(--muted);
  font-size: 12px;
}
.nav-legend {
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.question-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}
.question-nav button {
  height: 34px;
  border: 1px solid #d3dfeb;
  border-radius: 6px;
  background: #fff;
  color: #4a6074;
  cursor: pointer;
}
.question-nav button.done {
  border-color: #9cccf5;
  background: var(--blue-soft);
  color: var(--blue);
}
.question-nav button.current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.nav-help {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.question-panel {
  padding: 34px 42px;
  min-height: 590px;
}
.question-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.tag {
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}
.question-title {
  margin: 20px 0 25px;
  font-size: 20px;
  line-height: 1.75;
}
.case-title {
  margin: 25px 0 12px;
  padding: 12px 15px;
  background: #f7faff;
  border-left: 4px solid var(--blue);
  font-size: 16px;
}
.options {
  display: grid;
  gap: 11px;
}
.option {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
}
.option:hover,
.option:has(input:checked) {
  border-color: var(--blue);
  background: #f0f8ff;
}
.option input {
  margin: 4px 0 0;
}
.option b {
  color: var(--blue);
}
.feedback {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f1fbf5;
  border-left: 4px solid var(--green);
  color: #216441;
}
.feedback.wrong {
  background: #fff8ed;
  border-left-color: var(--orange);
  color: #805516;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.action-row .save-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.score {
  margin: 28px 0;
  padding: 26px;
  border-radius: 14px;
  background: var(--blue-soft);
  text-align: center;
}
.score strong {
  display: block;
  font-size: 48px;
  line-height: 1;
  color: var(--blue);
}
.score span {
  color: var(--muted);
}
.outcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.empty {
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 760px) {
  .site-header {
    padding: 0 16px;
  }
  .site-header .header-note {
    display: none;
  }
  .page {
    padding: 18px 14px;
  }
  .hero-card {
    min-height: 0;
    padding: 34px 24px 270px;
    background-size: 300px;
    background-position: right -28px bottom -15px;
  }
  .hero-card h1 {
    font-size: 29px;
  }
  .form-wrap,
  .outcome-wrap {
    align-items: start;
    padding: 28px 14px;
  }
  .form-card,
  .outcome-card {
    padding: 30px 22px;
  }
  .practice-header {
    padding: 0 15px;
  }
  .practice-header .mode {
    display: none;
  }
  .practice-header .person {
    font-size: 12px;
  }
  .practice-layout {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
  }
  .answer-card {
    position: static;
    width: 100%;
    padding: 16px;
  }
  .question-nav {
    max-height: 170px;
    overflow-y: auto;
    overflow-x: hidden;
    grid-template-columns: repeat(8, 1fr);
    padding-right: 2px;
  }
  .question-nav button {
    height: 31px;
  }
  .nav-help {
    display: none;
  }
  .question-panel {
    width: 100%;
    padding: 24px 18px;
    min-height: 0;
  }
  .question-title {
    font-size: 18px;
  }
  .action-row .btn {
    flex: 1;
    padding: 0 12px;
  }
  .action-row .save-note {
    width: 100%;
    margin: 4px 0 0;
    text-align: center;
  }
  .option {
    padding: 12px;
  }
  .score strong {
    font-size: 42px;
  }
}
.share-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 34px 30px 26px;
  text-align: center;
  box-shadow: 0 24px 72px #102b475c;
}
.share-dialog::backdrop {
  background: #102b4775;
}
.share-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.share-dialog h2 {
  margin: 0;
  font-size: 23px;
}
.share-dialog p {
  margin: 10px auto 18px;
  color: var(--muted);
  line-height: 1.65;
}
.share-dialog img {
  display: block;
  width: min(260px, 75vw);
  margin: 0 auto 18px;
  border: 10px solid #f2f8ff;
  border-radius: 16px;
}
.share-copy {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}
.share-copy input {
  min-width: 0;
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.share-copy button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
}
.share-dialog small {
  display: block;
  margin-top: 13px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.header-share,
.header-switch-bank {
  border: 1px solid #cbd9e7;
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  padding: 7px 14px;
  font-weight: 700;
  cursor: pointer;
}
.header-switch-bank {
  color: #315470;
}
.share-dialog .dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #6a7c90;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.share-native {
  width: 100%;
  margin: 0 0 10px;
}
@media (max-width: 760px) {
  .site-header {
    min-height: 56px;
  }
  .header-share {
    padding: 6px 12px;
    font-size: 14px;
  }
  .share-dialog {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding: 28px 22px calc(22px + env(safe-area-inset-bottom));
  }
  .share-dialog h2 {
    font-size: 21px;
  }
  .share-dialog img {
    width: 210px;
    margin-bottom: 15px;
  }
  .share-dialog .dialog-close {
    top: 14px;
    right: 16px;
  }
  .share-copy {
    margin-top: 4px;
  }
  .share-copy button {
    padding: 0 10px;
  }
  .share-dialog::backdrop {
    background: #102b477f;
  }
}
