* {
  box-sizing: border-box;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  background: #fff;
  color: inherit;
}
a {
  color: var(--green);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.space {
  margin-top: 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid .card {
  margin: 0;
}
.muted,
small {
  color: var(--muted);
}
p {
  line-height: 1.7;
  font-size: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
}
.danger {
  color: #b83d3d;
}
label {
  display: block;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  background: #fff;
}
textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  text-align: left;
}
.empty {
  text-align: center;
}
.activity {
  display: flex;
  flex-direction: column;
}
.option {
  width: 100%;
  margin: 12px 0;
}
.progress {
  border-radius: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}
.center {
  text-align: center;
}
.review {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.review p {
  margin: 7px 0;
  font-size: 13px;
}
.correct {
  color: #21856d;
}
.wrong,
.error {
  color: #c24a46;
}
.score {
  color: var(--green);
  font-weight: 650;
  line-height: 1.4;
}
.question-editor {
  border: 1px solid var(--border);
}
.question-editor .row > h3 {
  flex: 1;
}
dialog {
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  display: none;
  color: #fff;
  max-width: 90vw;
}
#connection {
  padding: 12px 24px;
  background: #fff2dc;
  color: #79470b;
  text-align: center;
  font-size: 13px;
}
:root {
  --green: #087f8c;
  --muted: #728096;
  --border: #e1e7ee;
  --sidebar: 228px;
  --header: 76px;
  background: #f4f6f9;
  color: #203247;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.assignment-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 30px;
}
.assignment-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
#app[data-layout="console"] main > .row:first-child {
  margin-bottom: 26px;
}
body {
  margin: 0;
}
button {
  min-height: 42px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #6bbbc8;
  outline-offset: 3px;
}
button:hover {
  background: #f5f8fb;
  border-color: #bac8d7;
}
.primary {
  background: #087f8c;
  border-color: #087f8c;
}
.primary:hover {
  background: #076e79;
  border-color: #076e79;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
button[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
header {
  height: var(--header);
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.top {
  height: 100%;
  max-width: none;
  padding: 0 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #193047;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: #087f8c;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 23px;
  font-family: serif;
}
.brand small {
  display: block;
  margin: 3px 0 0;
  font-size: 10px;
  letter-spacing: 2px;
  color: #7c8b9e;
}
.role-tag {
  font-size: 12px;
  color: #6c7f93;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}
.sidebar {
  position: fixed;
  top: var(--header);
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  background: #162638;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-label {
  font-size: 11px;
  color: #7f93a8;
  letter-spacing: 2px;
  margin: 0 16px 18px;
}
nav {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}
nav button {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aebfd1;
  background: transparent;
  font-weight: 500;
}
nav button:hover {
  background: #21364d;
  border-color: transparent;
  color: #fff;
}
nav button.active {
  background: #234558;
  color: #9ddde2;
  border: 1px solid #315a6b;
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8fa3b8;
  font-size: 12px;
  padding: 20px 16px 0;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57b9a3;
}
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 38px 36px 68px;
  min-height: calc(100dvh - var(--header));
}
#app[data-layout="console"] main {
  margin-left: var(--sidebar);
  max-width: 1600px;
  padding: 36px 38px 64px;
}
.narrow {
  max-width: 850px;
}
h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.5px;
  line-height: 1.5;
  margin: 0 0 22px;
}
h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
.between > div > h1 {
  margin-bottom: 0;
}
.page-heading {
  margin-bottom: 28px;
}
.section-heading {
  margin-bottom: 20px;
}
.section-heading h2 {
  margin: 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px #17283b04;
}
.grid {
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat {
  font-size: 34px;
  letter-spacing: -1px;
  line-height: 1.4;
  font-weight: 650;
  color: #1c3043;
  margin: 14px 0 0;
  font-variant-numeric: tabular-nums;
}
small {
  font-size: 12px;
}
.badge {
  border: 1px solid #cfe8e4;
  background: #eef8f5;
  color: #247666;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 12px;
}
.badge.off {
  background: #f5f6f8;
  border-color: #e4e7ec;
  color: #7b8797;
}
.activity {
  position: relative;
  min-height: 238px;
  padding: 28px;
  overflow: hidden;
}
.activity::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  bottom: 24px;
  width: 3px;
  background: #087f8c;
}
.activity h2 {
  font-size: 21px;
  margin: 26px 0;
}
.activity > .row {
  margin-top: auto;
  gap: 8px;
}
.activity > .row small {
  width: 100%;
  margin-bottom: 10px;
}
.activity .primary {
  flex: 1;
}
.activity > .row button {
  min-width: 100px;
}
.login {
  max-width: 420px;
  margin: 8vh auto;
}
.login > h1 {
  text-align: center;
  margin-bottom: 30px;
}
.login .card {
  padding: 28px;
  box-shadow: 0 12px 40px #1b30430a;
}
.login > a {
  display: block;
  text-align: center;
  font-size: 13px;
  margin-top: 22px;
}
.login .primary {
  width: 100%;
}
.stack {
  gap: 20px;
}
label {
  font-size: 13px;
  font-weight: 600;
  color: #425267;
  margin-bottom: 9px;
}
input,
select,
textarea {
  font-size: 14px;
  line-height: 20px;
  border: 1px solid #d5dee8;
  border-radius: 6px;
  padding: 11px 13px;
  min-height: 44px;
  color: #24354b;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #a7b8c9;
}
input::placeholder,
textarea::placeholder {
  color: #95a1b0;
}
input:disabled,
select:disabled {
  background: #f4f6f8;
  color: #7e8b9a;
}
select {
  padding-right: 32px;
}
input[type="checkbox"] {
  accent-color: #087f8c;
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.stack > button[type="submit"] {
  justify-self: start;
  min-width: 150px;
}
#settings,
#password-form,
#edit {
  max-width: 940px;
}
#profile {
  margin-top: 24px;
  padding: 30px;
}
#department-search {
  margin-bottom: 10px;
}
table {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
}
th {
  background: #f8fafc;
  color: #748397;
  font-size: 12px;
  font-weight: 600;
}
tbody tr:hover {
  background: #fbfcfd;
}
tr:last-child td {
  border-bottom: 0;
}
td button {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}
td select {
  min-height: 38px;
  min-width: 150px;
  padding: 8px 10px;
  font-size: 13px;
}
.table-footer {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.empty {
  color: #8b98a8;
  padding: 44px 20px;
  font-size: 13px;
}
.code {
  font-size: 38px;
  letter-spacing: 8px;
  font-weight: 650;
  color: #163e52;
  font-variant-numeric: tabular-nums;
}
.option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  text-align: left;
  white-space: normal;
  min-height: 66px;
  padding: 19px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 400;
}
.option.selected {
  border-color: #087f8c;
  background: #edf8f8;
  box-shadow: inset 0 0 0 1px #087f8c;
}
.letter {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #dbe2e9;
  border-radius: 6px;
  color: #728296;
  font-size: 13px;
  font-weight: 600;
}
.selected .letter {
  background: #087f8c;
  border-color: #087f8c;
  color: #fff;
}
.progress {
  height: 4px;
  margin: 26px 0 22px;
  background: #e1e7ed;
}
.eyebrow {
  font-size: 12px;
  color: #7a8b9d;
  letter-spacing: 1px;
}
.score {
  font-size: 72px;
  letter-spacing: -3px;
}
.score small {
  font-size: 15px;
  letter-spacing: 0;
}
.center {
  padding: 24px 0;
}
.center .primary {
  margin: 12px 6px;
}
.question-editor {
  padding: 0;
  border-radius: 7px;
  background: #fff;
  margin: 12px 0;
}
.question-editor[open] {
  padding-bottom: 20px;
}
.question-editor summary {
  padding: 17px 18px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.question-editor[open] summary {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.question-editor > .row,
.question-editor > .stack {
  margin-left: 20px;
  margin-right: 20px;
}
.question-editor > .row {
  margin-bottom: 20px;
}
.question-editor > .row h3 {
  margin: 0;
}
.question-editor label input,
.question-editor label textarea {
  margin-top: 8px;
}
dialog {
  width: min(650px, calc(100% - 40px));
  max-height: 85dvh;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 24px 80px #12243a35;
  color: #24354b;
}
dialog::backdrop {
  background: #13273d66;
}
.confirm-dialog {
  max-width: 400px;
}
.confirm-dialog h2 {
  font-size: 18px;
  margin: 0 0 32px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.dialog-actions button {
  min-width: 88px;
}
#toast {
  background: #193449;
  font-size: 13px;
  border-radius: 8px;
  box-shadow: 0 8px 32px #11283e20;
  z-index: 100;
}
#app[data-layout="console"] #connection {
  margin-left: var(--sidebar);
}
#board-activity {
  max-width: 340px;
  margin-bottom: 24px;
}
.footer {
  display: none;
}
[hidden] {
  display: none !important;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1000px) {
  :root {
    --sidebar: 196px;
  }
  .top {
    padding: 0 22px;
  }
  #app[data-layout="console"] main {
    padding: 28px 24px;
  }
  .sidebar {
    padding: 24px 12px;
  }
  nav button {
    padding: 12px;
  }
  .grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .card {
    padding: 20px;
  }
}
@media (max-width: 720px) {
  :root {
    --header: 68px;
  }
  .top {
    padding: 0 18px;
  }
  .brand {
    font-size: 16px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 21px;
  }
  .brand small {
    display: block;
    font-size: 9px;
  }
  .role-tag {
    font-size: 12px;
    padding-right: 10px;
  }
  .top .row {
    gap: 7px;
  }
  .top button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .sidebar {
    position: sticky;
    top: var(--header);
    height: auto;
    width: 100%;
    padding: 0 12px;
    background: #fff;
    z-index: 15;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 4px;
    padding: 8px 0;
  }
  nav button {
    width: auto;
    min-width: max-content;
    height: 40px;
    font-size: 12px;
    color: #6d7e91;
    padding: 8px 12px;
  }
  nav svg {
    width: 16px;
    height: 16px;
  }
  nav button.active {
    background: #eaf5f6;
    border-color: transparent;
    color: #087f8c;
  }
  nav button:hover {
    background: #f1f5f8;
    color: #087f8c;
  }
  #app[data-layout="console"] main {
    margin-left: 0;
    padding: 26px 16px;
  }
  #app[data-layout="console"] #connection {
    margin-left: 0;
  }
  main {
    padding: 26px 18px 48px;
  }
  h1 {
    font-size: 23px;
  }
  h2 {
    font-size: 15px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 20px;
  }
  .activity {
    min-height: 220px;
    padding: 24px;
  }
  .activity h2 {
    font-size: 20px;
  }
  .stat {
    font-size: 29px;
  }
  .login {
    margin: 6vh auto;
  }
  .option {
    font-size: 15px;
    padding: 17px 18px;
  }
  #profile {
    padding: 24px;
  }
  .score {
    font-size: 62px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
