:root {
  --blue: #0755f9;
  --blue-light: #e8efff;
  --ink: #17181b;
  --muted: #777b82;
  --line: #e5e5e8;
  --red: #b72532;
  --red-light: #fff1f1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font:
    16px/1.55 Arial,
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  transition:
    background 0.12s,
    border-color 0.12s;
}
button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #88adff;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
button.primary:hover {
  background: #0043cc;
  color: white;
}
button.plain {
  border: 0;
  background: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 21px;
  font-weight: 650;
}
header {
  height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 3%;
  gap: 30px;
}
.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.5px;
  border: 0;
  background: none;
  padding: 0 42px 0 0;
  position: relative;
}
.brand:after {
  content: "";
  height: 24px;
  width: 1px;
  background: var(--line);
  position: absolute;
  right: 0;
  top: 12px;
}
nav {
  display: flex;
  height: 100%;
  align-items: stretch;
  gap: 38px;
}
nav button {
  position: relative;
  border: 0;
  background: none;
  padding: 0 4px;
  font-size: 17px;
  white-space: nowrap;
  border-radius: 0;
}
nav button.active:after {
  content: "";
  position: absolute;
  height: 4px;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  bottom: 0;
  left: 4px;
  right: 4px;
}
#login {
  margin-left: auto;
  color: var(--blue);
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  white-space: nowrap;
}
.ico {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex: none;
}
.ico svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.layout {
  display: grid;
  grid-template-columns: 17.7% minmax(0, 1fr) 23%;
  max-width: 1800px;
  margin: 46px auto 40px;
  min-height: calc(100vh - 166px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 8px 27px 30px;
}
.sidebar h2 {
  font-size: 20px;
  margin: 0 0 24px 15px;
}
.unit-list {
  display: grid;
  gap: 6px;
}
.unit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  border: 0;
  background: white;
  text-align: left;
  padding: 12px 22px;
  font-size: 18px;
  min-height: 49px;
}
.unit.active {
  background: var(--blue-light);
  font-weight: 600;
}
.unit.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  background: var(--blue);
  border-radius: 4px;
}
.unit .count {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.sidebar-extra {
  margin-top: 30px;
  display: grid;
  gap: 8px;
  padding: 0 12px;
}
.sidebar-extra button {
  padding: 8px 12px;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
}
.main {
  min-width: 0;
  padding: 8px 34px 24px;
  display: flex;
  flex-direction: column;
}
.crumb {
  font-size: 19px;
  color: #555b64;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.crumb b {
  color: var(--ink);
  font-weight: 600;
}
.mode {
  border: 0;
  color: #777;
  font-size: 13px;
  background: white;
  max-width: 120px;
}
.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 28px 0 24px;
}
.number {
  font-size: 30px;
  white-space: nowrap;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.number strong {
  font-size: 36px;
  font-weight: 700;
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 52%;
  color: var(--muted);
  font-size: 16px;
}
.bar {
  height: 11px;
  background: #eaeaec;
  border-radius: 20px;
  flex: 1;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 20px;
}
.question-block {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 27px 0 32px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-height: 145px;
}
.question {
  font-size: clamp(24px, 2.23vw, 35px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.55px;
  flex: 1;
  overflow-wrap: anywhere;
}
.blank {
  display: inline-block;
  min-width: 56px;
  border-bottom: 2px solid currentColor;
  line-height: 1.1;
}
.blank.solved {
  color: var(--blue);
  border-bottom: 0;
}
.bookmark {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 6px 0;
  font-size: 15px;
  white-space: nowrap;
  color: var(--muted);
}
.bookmark.on {
  color: var(--blue);
}
.bookmark.on svg {
  fill: var(--blue-light);
}
.options-title {
  font-size: 19px;
  margin: 28px 0 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.options-title:before {
  content: "";
  width: 5px;
  height: 25px;
  background: var(--blue);
  border-radius: 3px;
}
.options-title span {
  font-weight: 400;
  font-size: 16px;
  color: #777;
}
.options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 11px;
  padding: 0 6px;
}
.option {
  font-size: clamp(14px, 1.28vw, 19px);
  min-height: 58px;
  padding: 10px 7px;
  overflow-wrap: anywhere;
  border: 1px solid #d9dadf;
  box-shadow: 0 1px 2px #00000005;
  line-height: 1.3;
}
.option:hover:not(:disabled) {
  background: #f5f8ff;
}
.option:disabled {
  opacity: 1;
  cursor: default;
}
.option.right {
  background: var(--blue-light);
  border-color: #7da5ff;
  color: #0642c5;
  font-weight: 600;
}
.option.wrong {
  background: var(--red-light);
  border-color: #e8a3a9;
  color: var(--red);
}
.feedback {
  padding: 15px 19px;
  border-left: 4px solid var(--blue);
  margin: 22px 6px 0;
  background: #f5f8ff;
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}
.feedback.bad {
  background: var(--red-light);
  border-color: var(--red);
}
.feedback p {
  margin-top: 6px;
  color: #444b56;
}
.bottom {
  border-top: 1px solid var(--line);
  margin-top: 54px;
  padding: 24px 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bottom button {
  padding: 10px 22px;
  min-width: 128px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.rightbar {
  border-left: 1px solid var(--line);
  padding: 8px 25px 30px;
}
.rightbar h2 {
  margin-bottom: 21px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
  margin: 0 0 32px;
}
.stat + .stat {
  border-left: 1px solid var(--line);
}
.stat strong {
  display: block;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat small {
  display: block;
  color: #86888d;
  font-size: 15px;
  margin-top: 6px;
}
.answer-head {
  border-top: 1px solid var(--line);
  padding-top: 25px;
}
.answer-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.answer-map button {
  position: relative;
  aspect-ratio: 1.12;
  min-height: 39px;
  padding: 0;
  font-size: 17px;
  border-color: #dddfe3;
}
.answer-map .done {
  background: #dbe7ff;
  border-color: #d0dfff;
  color: #1e4c9c;
}
.answer-map .incorrect {
  background: #fff0f1;
  border-color: #e9bfc5;
  color: #b72532;
}
.answer-map .current {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.answer-map .marked:after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  background: #e79916;
  border-radius: 50%;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #62666e;
  margin: 25px 0;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.swatch {
  width: 18px;
  height: 18px;
  border: 1px solid #dadddf;
  border-radius: 5px;
  display: inline-block;
}
.swatch.done {
  background: #dbe7ff;
  border: 0;
}
.swatch.bad {
  background: #fff0f1;
  border: 1px solid #e9bfc5;
}
.empty,
.summary {
  border-top: 1px solid var(--line);
  padding: 42px 4px;
  line-height: 1.8;
}
.empty h1,
.summary h1 {
  font-size: 30px;
  margin-bottom: 12px;
}
.empty p,
.summary p {
  color: var(--muted);
  margin-bottom: 20px;
}
.summary button,
.empty button {
  padding: 10px 18px;
  margin: 10px 8px 0 0;
}
.review-tools {
  display: flex;
  gap: 8px;
  margin: 8px 0 24px;
}
.review-tools button {
  padding: 8px 12px;
}
.review-tools .active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: #c7d7fd;
}
.muted {
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  max-width: min(420px, calc(100% - 28px));
  width: 100%;
  box-shadow: 0 12px 50px #0002;
}
dialog::backdrop {
  background: #17181b44;
}
dialog h2 {
  margin-bottom: 10px;
}
dialog p {
  color: var(--muted);
  margin-bottom: 14px;
}
dialog label {
  display: block;
  font-size: 14px;
  margin-top: 12px;
}
dialog input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d8dbe1;
  border-radius: 7px;
  margin-top: 5px;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
dialog button {
  padding: 9px 16px;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #21242a;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 9;
  max-width: 90vw;
  font-size: 14px;
}
.skip {
  position: absolute;
  left: 8px;
  top: -100px;
}
.skip:focus {
  top: 8px;
  z-index: 10;
  background: white;
  padding: 8px;
}
.small-only {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (min-width: 601px) {
  .bottom #showMap {
    display: none;
  }
}
@media (min-width: 1450px) {
  .progress-head {
    margin: 37px 0 33px;
  }
  .layout {
    margin-top: 47px;
  }
  .main {
    padding-left: 36px;
    padding-right: 34px;
  }
  .rightbar {
    padding-left: 27px;
    padding-right: 25px;
  }
  .options {
    gap: 14px 12px;
  }
  .option {
    min-height: 61px;
  }
  .bottom {
    margin-top: 57px;
  }
  .question-block {
    min-height: 157px;
  }
  .options-title {
    margin-top: 30px;
    margin-bottom: 28px;
  }
}
@media (max-width: 1150px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr) 240px;
  }
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .sidebar h2 {
    font-size: 17px;
    margin-left: 8px;
  }
  .unit {
    font-size: 16px;
    padding-left: 13px;
  }
  .main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .rightbar {
    padding-left: 17px;
    padding-right: 17px;
  }
  .option {
    font-size: 15px;
  }
  .stats strong {
    font-size: 21px;
  }
  .answer-map {
    gap: 6px;
  }
  .answer-map button {
    font-size: 15px;
  }
  .legend {
    gap: 8px;
  }
  .options {
    padding: 0;
    gap: 9px;
  }
  .bottom {
    margin-top: 35px;
  }
  .options-title span {
    font-size: 13px;
  }
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 160px minmax(0, 1fr);
    margin-top: 24px;
  }
  .rightbar {
    grid-column: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px;
  }
  .sidebar {
    grid-row: 1/3;
  }
  .rightbar .answer-map {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  .rightbar .stats {
    max-width: 340px;
  }
  .answer-map button {
    aspect-ratio: 1.2;
  }
  .options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  header {
    height: 60px;
    padding: 0 16px;
    gap: 18px;
  }
  .brand {
    font-size: 24px;
    padding-right: 15px;
  }
  .brand:after {
    top: 8px;
    height: 20px;
  }
  nav {
    gap: 15px;
  }
  nav button {
    font-size: 15px;
  }
  #login {
    font-size: 14px;
    gap: 4px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: calc(100vh - 60px);
  }
  .sidebar {
    padding: 16px 14px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar h2 {
    font-size: 15px;
    margin: 0 0 10px 2px;
  }
  .unit-list {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 3px;
  }
  .unit {
    width: auto;
    flex: none;
    gap: 6px;
    font-size: 14px;
    padding: 7px 11px;
    min-height: 38px;
  }
  .unit .count {
    font-size: 12px;
  }
  .unit.active:before {
    display: none;
  }
  .sidebar-extra {
    display: none;
  }
  .main {
    padding: 20px 16px;
  }
  .crumb {
    font-size: 15px;
  }
  .mode {
    font-size: 12px;
  }
  .progress-head {
    margin: 18px 0;
  }
  .number {
    font-size: 23px;
  }
  .number strong {
    font-size: 27px;
  }
  .progress-wrap {
    gap: 10px;
    font-size: 13px;
  }
  .bar {
    height: 7px;
  }
  .question-block {
    padding: 21px 0;
    min-height: 0;
    gap: 8px;
  }
  .question {
    font-size: 24px;
    letter-spacing: -0.4px;
  }
  .bookmark {
    font-size: 13px;
  }
  .options-title {
    font-size: 17px;
    margin: 20px 0 15px;
  }
  .options-title span {
    font-size: 13px;
  }
  .options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .option {
    min-height: 48px;
    font-size: 14px;
  }
  .bottom {
    margin-top: 26px;
    padding: 18px 0 2px;
  }
  .bottom button {
    min-width: 0;
    font-size: 15px;
    padding: 9px 16px;
  }
  .rightbar {
    padding: 22px 16px;
    border-left: 0;
  }
  .rightbar h2 {
    font-size: 18px;
    margin-bottom: 15px;
  }
  .rightbar .answer-map {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .answer-map button {
    aspect-ratio: 1.5;
  }
  .stats {
    margin-bottom: 18px;
  }
  .legend {
    margin: 18px 0;
  }
  .small-only {
    display: inline-block;
  }
  .feedback {
    margin-left: 0;
    margin-right: 0;
  }
  .toast {
    width: max-content;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.stem {
  flex: 1;
  min-width: 0;
}
.stem small,
.admin small {
  display: block;
  color: #656b75;
  font-size: 13px;
  margin-bottom: 8px;
}
.progress-wrap progress {
  appearance: none;
  min-width: 0;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #eaeaec;
}
.progress-wrap progress::-webkit-progress-bar {
  background: #eaeaec;
}
.progress-wrap progress::-webkit-progress-value {
  background: var(--blue);
  border-radius: 10px;
}
.progress-wrap progress::-moz-progress-bar {
  background: var(--blue);
}
.chosen {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.options.long {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.subtle,
.pager button {
  padding: 7px 12px;
  font-size: 14px;
}
.pager,
.links {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}
.layout > * {
  min-width: 0;
}
.sidebar h2,
.unit,
.feedback,
.admin td,
.crumb,
.admin h1 {
  overflow-wrap: anywhere;
}
#bankSelect {
  margin-bottom: 12px;
  max-width: 100%;
}
.admin {
  max-width: 1100px;
  margin: 42px auto;
  padding: 0 24px;
}
.admin section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
}
.admin input,
.admin select,
dialog select,
dialog textarea,
#bankSelect {
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: white;
  color: var(--ink);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.toolbar h1,
.toolbar h2 {
  margin-right: auto;
}
.admin button,
header > #logout {
  padding: 7px 12px;
}
.admin table {
  width: 100%;
  border-collapse: collapse;
}
.admin th,
.admin td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
}
.admin td:first-child {
  width: 32px;
}
.admin td:last-child {
  width: 64px;
}
.admin small {
  margin: 4px 0;
}
.admin input[type="checkbox"] {
  min-height: 0;
}
.status,
.subtle {
  color: #505967;
}
.end {
  margin-left: auto;
}
a {
  color: var(--blue);
}
header a.brand {
  color: var(--ink);
  text-decoration: none;
}
.gate {
  margin: 12vh auto;
  max-width: 450px;
  padding: 24px;
}
.gate h1 {
  margin-bottom: 20px;
}
.links a {
  font-size: 14px;
}
dialog {
  max-height: 85dvh;
  overflow: auto;
}
dialog select,
dialog textarea {
  width: 100%;
  display: block;
}
dialog input[type="file"] {
  font-size: 14px;
}
#preview {
  margin-top: 12px;
  overflow-wrap: anywhere;
}
#formError,
#authError {
  color: var(--red);
}
#authError:empty,
#formError:empty {
  display: none;
}
.feedback p:empty {
  display: none;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (max-width: 600px) {
  header {
    gap: 12px;
    padding: 0 12px;
  }
  nav {
    gap: 8px;
  }
  .brand {
    padding-right: 12px;
  }
  .sidebar {
    min-width: 0;
  }
  .main {
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }
  .rightbar {
    display: none;
  }
  .bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    background: white;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    z-index: 2;
  }
  .bottom button {
    min-height: 44px;
  }
  .bottom .small-only {
    display: block;
  }
  .question-block {
    min-height: 115px;
  }
  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom));
    pointer-events: none;
  }
  .options.long {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stem small {
    font-size: 12px;
  }
  .admin {
    padding: 0 14px;
    margin: 20px auto;
  }
  .admin button {
    font-size: 14px;
  }
  .admin table {
    font-size: 14px;
  }
  .toolbar h1 {
    font-size: 24px;
  }
  dialog input,
  dialog textarea,
  dialog select {
    font-size: 16px;
  }
  .unit.active {
    color: #144dbd;
  }
  .unit-list {
    max-width: 100%;
  }
  #mobileMap .answer-map {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  #mapDialog button {
    margin-top: 5px;
  }
  .sidebar .unit {
    max-width: 80vw;
  }
  .options-title span {
    color: #666;
  }
  .main:has(.empty),
  .main:has(.summary) {
    padding-bottom: 24px;
  }
}

.admin td:last-child {
  width: 84px;
}
.admin td button {
  white-space: nowrap;
}
dialog .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555b64;
}
dialog .check input {
  width: auto;
  margin: 0;
}

.mark-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e79916;
}

@media (max-width: 600px) {
  .blank.solved {
    font-size: 0;
    border-bottom: 2px solid currentColor;
    min-height: 0.5rem;
  }
}
