:root {
  color-scheme: light;
  --cyan: #08a8d6;
  --cyan-dark: #047fa7;
  --panel: #f7fbef;
  --side: #edf6df;
  --line: #d5e2c7;
  --ink: #283238;
  --muted: #6c7a80;
  --green: #189234;
  --orange: #b87502;
  --bad: #c6362b;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #0b89af;
}

button,
select {
  font: inherit;
}

.exam-shell {
  min-height: 100vh;
  padding: 18px 28px 22px;
  background:
    linear-gradient(180deg, #13b9e6 0 86px, #0a8eb9 86px 100%),
    var(--cyan);
}

.exam-title {
  height: 70px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 1px rgba(0, 0, 0, .2);
}

.exam-board {
  min-height: calc(100vh - 106px);
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 8px 22px rgba(0, 61, 85, .28);
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 18px;
  padding: 22px 18px;
  background: rgba(235, 246, 221, .94);
  border-right: 1px solid var(--line);
}

.time-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #466065;
  font-size: 20px;
}

.clock {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #6f8589;
  border-radius: 50%;
  font-size: 19px;
}

#timer {
  color: var(--orange);
  font-size: 28px;
}

.candidate h2,
.answer-card h2 {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 5px solid #1aa1d0;
  color: #466065;
  font-size: 20px;
}

.avatar {
  width: 96px;
  height: 96px;
  margin: 0 0 18px 22px;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 32%, #f2d7a2 0 25px, transparent 26px),
    radial-gradient(ellipse at 50% 86%, #67bfbd 0 48px, transparent 49px),
    radial-gradient(ellipse at 50% 18%, #1d1d1d 0 34px, transparent 35px),
    #dfead3;
}

.candidate p {
  margin: 0 0 14px 22px;
  color: #66767a;
  font-size: 15px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filters label {
  display: grid;
  gap: 6px;
  color: #53686d;
  font-weight: 700;
}

.filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c4d3ba;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}

.filters .check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters input {
  width: 17px;
  height: 17px;
  accent-color: #158ac0;
}

.answer-card {
  min-height: 0;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: 13px 12px;
  align-content: start;
  max-height: 290px;
  overflow: auto;
  padding-right: 6px;
}

.card-item {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #334;
  font-weight: 800;
}

.card-item.current {
  color: #fff;
  background: #118fc5;
}

.card-item.done {
  color: #fff;
  background: var(--green);
}

.card-item.wrong {
  color: #fff;
  background: var(--bad);
}

.submit {
  width: 170px;
  min-height: 50px;
  justify-self: center;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #b87502;
  font-size: 20px;
  font-weight: 800;
}

.summary {
  margin: -6px 0 0;
  color: #62777c;
  font-size: 14px;
  text-align: center;
}

.question-area {
  position: relative;
  min-width: 0;
  padding: 36px clamp(30px, 5vw, 70px) 96px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4d5c60;
  font-size: 20px;
}

#typeBadge {
  padding: 4px 10px;
  border-radius: 3px;
  color: #fff;
  background: #19a9dc;
  font-size: 16px;
}

.mobile-card-btn {
  display: none;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: #128fc7;
  font-weight: 700;
}

h1 {
  margin: 18px 0 28px;
  color: #27363a;
  font-size: clamp(20px, 2.3vw, 30px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.question-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: center;
  gap: 24px;
  margin: 4px auto 26px;
}

.question-images.single {
  grid-template-columns: minmax(0, max-content);
}

.question-images img {
  max-width: min(520px, 100%);
  max-height: 300px;
  object-fit: contain;
}

.choices {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.choices.image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border: 0;
  background: transparent;
  text-align: left;
  color: #415155;
  cursor: pointer;
}

.choice-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #8a9a9e;
  border-radius: 50%;
  font-size: 16px;
}

.choice-text {
  font-size: 21px;
  line-height: 1.45;
}

.choice img {
  display: block;
  max-width: min(240px, 100%);
  max-height: 160px;
  margin-top: 8px;
  object-fit: contain;
}

.choice.selected .choice-mark {
  color: #fff;
  border-color: #128fc7;
  background: #128fc7;
}

.choice.correct .choice-mark {
  border-color: var(--green);
  background: var(--green);
}

.choice.incorrect .choice-mark {
  border-color: var(--bad);
  background: var(--bad);
}

.feedback {
  min-height: 34px;
  margin-top: 18px;
  font-size: 22px;
  font-weight: 800;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--bad);
}

.actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  justify-content: center;
  gap: clamp(28px, 10vw, 220px);
}

.actions button {
  width: 150px;
  height: 46px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--green);
  font-size: 18px;
  font-weight: 700;
}

#revealBtn {
  background: #128fc7;
}

.card-modal {
  display: none;
}

@media (max-width: 900px) {
  .exam-shell {
    padding: 10px;
  }

  .exam-board {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto;
    gap: 12px;
  }

  .candidate,
  .answer-card {
    display: none;
  }

  .mobile-card-btn {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }

  .answer-grid {
    grid-template-columns: repeat(6, 42px);
    max-height: 160px;
  }

  .question-area {
    padding: 24px 18px 104px;
  }

  .actions {
    gap: 10px;
  }

  .actions button {
    width: 31%;
  }

  .question-images,
  .choices.image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .question-images img {
    max-height: 180px;
  }

  .choice {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .choice-text {
    font-size: 18px;
  }

  .choice img {
    max-height: 128px;
  }

  .card-modal.open {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 50, 70, .48);
  }

  .card-dialog {
    width: min(420px, 100%);
    max-height: 76vh;
    overflow: auto;
    padding: 16px;
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
  }

  .card-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    color: #466065;
    font-size: 20px;
  }

  .card-dialog-head button {
    min-height: 34px;
    border: 0;
    border-radius: 3px;
    color: #fff;
    background: #128fc7;
  }

  .card-dialog .answer-grid {
    max-height: none;
  }
}
