:root {
  --bg: #f5f7f5;
  --bg-soft: #edf2ee;
  --panel: #fff;
  --line: #dce4de;
  --line-soft: #e9eeea;
  --text: #243b32;
  --dim: #708078;
  --dim2: #839088;
  --gold: #a87623;
  --green: #23805e;
  --red: #c24f43;
  --blue: #247567;
  --purple: #7c69a5;
  --orange: #b57527;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body {
  overflow-x: hidden;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
:focus-visible {
  outline: 3px solid #6aa993;
  outline-offset: 3px;
}
.hide,
[hidden] {
  display: none !important;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 12px #243b3204;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn:hover:not(:disabled) {
  background: #f0f5f1;
  border-color: #b7c9bf;
}
.btn.primary,
.btn.gold {
  background: #28725b;
  color: #fff;
  border-color: #28725b;
}
.btn.primary:hover:not(:disabled),
.btn.gold:hover:not(:disabled) {
  background: #1c5c48;
  border-color: #1c5c48;
}
.btn.danger {
  color: var(--red);
  border-color: #e7cbc6;
  background: #fff;
}
.btn.danger:hover:not(:disabled) {
  background: #fcf1ef;
}
.btn.ghost {
  background: transparent;
}
.btn.block {
  width: 100%;
}
.input {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.input::placeholder {
  color: #9ba79f;
}
.input:focus {
  border-color: #599b83;
  box-shadow: 0 0 0 3px #28725b12;
}
.input.code {
  letter-spacing: 10px;
  font: 24px var(--mono);
}
.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
}
.muted {
  color: var(--dim);
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--dim);
}
.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.alert.error {
  background: #fcf0ed;
  color: #b34d40;
  border: 1px solid #efd3cc;
}
.alert.ok {
  background: #eef7f0;
  color: var(--green);
}
.alert.info {
  background: #edf5f1;
  color: var(--blue);
}
.alert.warn {
  background: #fcf5e8;
  color: var(--orange);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#toastWrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: grid;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 32px #243b3217;
  padding: 12px 20px;
  font-size: 13px;
  animation: toastIn 0.2s ease;
}
.toast.ok {
  color: var(--green);
}
.toast.err {
  color: var(--red);
}
.toast.gold {
  color: var(--gold);
}
.toast.out {
  opacity: 0;
  transition: opacity 0.2s;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #cbd7ce;
  border-radius: 4px;
}
/* One countdown component for every classroom page. */
.countdown {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: none;
  place-items: center;
  background: #18372fed;
  color: #fff;
  text-align: center;
  backdrop-filter: blur(12px);
}
.countdown.show {
  display: grid;
}
.countdown .number {
  font: 500 clamp(100px, 20vw, 210px) / 1 var(--mono);
  letter-spacing: -8px;
  margin: 18px 0;
}
.countdown .cd-task {
  font-size: 22px;
}
.countdown .cd-note {
  color: #b0c9be;
  font-size: 13px;
}
.dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 100px #18372f30;
}
.dialog::backdrop {
  background: #1b33285c;
  backdrop-filter: blur(3px);
}
.dialog h2 {
  font-size: 19px;
  margin-bottom: 12px;
}
.dialog p {
  color: var(--dim);
  white-space: pre-line;
  line-height: 1.8;
  margin-bottom: 24px;
}
.dialog .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.detail-dialog {
  padding: 0;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}
.detail-dialog[open] {
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.modal-close {
  border: 0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: #f0f4ed;
  color: #526d5a;
  font-size: 24px;
  flex-shrink: 0;
}
.modal-body {
  padding: 24px 26px;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-body h3 {
  font-size: 14px;
  margin: 0 0 12px;
}
.modal-body h3 small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 5px;
  color: var(--dim2);
}
.evaluation-dialog {
  width: min(640px, calc(100vw - 32px));
}
.evaluation-dialog .modal-body {
  font-size: 13px;
  line-height: 1.8;
}
.evaluation-dialog section {
  margin: 20px 0;
}
.evaluation-dialog h3 {
  font-size: 13px;
  margin-bottom: 7px;
}
.evaluation-dialog ul {
  margin: 0;
  padding-left: 20px;
  color: var(--dim);
}
.evaluation-dialog li {
  margin: 4px 0;
}
.evaluation-dialog .evaluation-summary {
  padding: 16px;
  margin: 0;
  border-radius: 8px;
  background: #eef4e7;
  color: #3e5f43;
  font-size: 14px;
  line-height: 1.8;
}
.evaluation-pending {
  text-align: center;
  padding: 30px 12px;
}
.evaluation-pending h3 {
  margin: 16px 0 8px;
  font-size: 16px;
}
.evaluation-pending p {
  font-size: 12px;
}
.evaluation-note {
  display: block;
  color: var(--dim2);
  font-size: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 15px;
}
.evaluation-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #e4ecd9;
  border-top-color: #6c8d53;
  border-radius: 50%;
  animation: evaluation-spin 1s linear infinite;
}
@keyframes evaluation-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 650px) {
  .modal-head,
  .modal-body {
    padding: 18px;
  }
}
