:root {
  color-scheme: light;
  --ink: #132038;
  --muted: #52627b;
  --canvas: #f1f4fa;
  --white: #fff;
  --line: #d9e1ed;
  --primary: #214fba;
  --primary-hover: #17409f;
  --radius: 17px;
  font: 16px/1.55 'Segoe UI','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
}

*,*::before,*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

.wrap {
  width: min(1160px,calc(100% - 64px));
  margin-inline: auto;
}

.top {
  background: #101b30;
  color: white;
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 65px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: .04em;
}

.brand-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #6e9af9;
}

.brand-mark::after,.screen-mark::after {
  content: '';
  position: absolute;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #101b30;
  top: 9px;
  left: 12px;
}

.top-link {
  margin-left: auto;
  color: #e5edff;
  text-decoration: none;
}

.top-link:hover {
  text-decoration: underline;
}

.intro {
  padding: 36px 0 24px;
}

.intro h1,h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .015em;
}

.intro p,.muted {
  margin: 0;
  color: var(--muted);
}

.viewer-layout,.manage-layout {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(310px,1fr);
  gap: 23px;
  align-items: start;
}

.screen,.panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 3px 14px #263a6010;
}

.panel {
  padding: 22px;
}

.screen {
  background: #101a2e;
  color: #fff;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16/10;
  background: radial-gradient(ellipse at 50% 42%,#202f53 0%,#121e35 62%,#0d1727 100%);
}

.video-stage video {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: #0b101a;
  object-fit: contain;
}

.placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #cbd8f5;
  padding: 16px;
  text-align: center;
}

.placeholder strong {
  color: #f4f7ff;
  font-size: 1.2rem;
}

.screen-mark {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  border: 1px solid #93affb73;
  background: #6589e227;
  position: relative;
  margin-bottom: 9px;
}

.screen-mark::after {
  border-left-color: #bcceff;
  border-top-width: 10px;
  border-bottom-width: 10px;
  border-left-width: 15px;
  top: 20px;
  left: 25px;
}

.screen-caption {
  padding: 12px 16px;
  color: #cfdbef;
  background: #17243c;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #ffffff14;
  font-size: .9rem;
}

.screen-caption span:first-child {
  overflow-wrap: anywhere;
}

.screen-caption span:last-child {
  white-space: nowrap;
}

.controls {
  padding: 10px 16px 14px;
  display: grid;
  gap: 9px;
  background: #17243c;
  color: #dfe8fc;
}

.scrubber,.play-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.scrubber span {
  font-variant-numeric: tabular-nums;
  font-size: .88rem;
}

.scrubber input {
  flex: 1;
  min-width: 0;
  accent-color: #8eb3ff;
}

.play-actions {
  flex-wrap: wrap;
}

.play-actions button,.speed select {
  background: #223450;
  border: 1px solid #ffffff30;
  color: #fff;
  font-size: .88rem;
  min-height: 36px;
  padding: 6px 9px;
}

.speed {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
  color: #e2eafa;
  font-size: .88rem;
}

.speed option {
  background: #223450;
  color: white;
}

h2 {
  font-size: 1.18rem;
  margin: 0 0 17px;
  font-weight: 750;
}

h3 {
  font-size: 1rem;
  margin: 0 0 7px;
}

form {
  display: grid;
  gap: 8px;
}

label {
  font-size: .93rem;
  font-weight: 650;
}

form label:not(:first-child) {
  margin-top: 4px;
}

button,input,select {
  font: inherit;
}

input:not([type=range]),select {
  width: 100%;
  border: 1px solid #bcc9dd;
  border-radius: 9px;
  background: #fff;
  color: inherit;
  min-height: 44px;
  padding: 9px 11px;
}

input::placeholder {
  color: #687790;
}

input[type=file] {
  font-size: .9rem;
}

input[type=file]::file-selector-button {
  border: 0;
  border-radius: 5px;
  padding: 4px 7px;
  margin-right: 7px;
  background: #e9effa;
  color: #203b6d;
  font: inherit;
  cursor: pointer;
}

button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 13px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

button:disabled,input:disabled {
  opacity: .57;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: white;
  margin-top: 5px;
}

.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.secondary {
  color: #213b69;
  background: #f5f8fd;
  border-color: #cbd6e6;
}

.secondary:hover:not(:disabled) {
  background: #e7eefc;
}

.compact {
  min-height: 35px;
  font-size: .9rem;
  padding: 5px 10px;
}

.full {
  width: 100%;
}

:focus-visible {
  outline: 3px solid #71a2ff;
  outline-offset: 3px;
}

#access-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.course-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-weight: 750;
}

.course-result>span:first-child {
  overflow-wrap: anywhere;
}

.pill {
  display: inline-block;
  flex: none;
  font-size: .82rem;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 999px;
  background: #eaf0fa;
  color: #28436d;
  padding: 4px 9px;
}

.pill[data-state=approved] {
  background: #d9f5e9;
  color: #075a41;
}

.pill[data-state=pending] {
  background: #fff1cb;
  color: #705307;
}

.pill[data-state=expired],.pill[data-state=revoked],.pill[data-state=rejected] {
  background: #f9e8e7;
  color: #8c2b25;
}

.access .muted {
  font-size: .94rem;
  margin: 9px 0 13px;
}

.request-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  background: #f3f6fc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  margin-bottom: 9px;
  font-size: .88rem;
}

.request-info strong {
  font-family: Consolas,monospace;
  letter-spacing: .025em;
}

.notice {
  margin: 13px 0 0;
  padding: 9px 12px;
  color: #234479;
  background: #edf3fd;
  border-radius: 8px;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.notice.error {
  color: #891f23;
  background: #fcecee;
}

#file-box {
  display: grid;
  gap: 7px;
}

#file-box label {
  display: block;
}

.admin-main {
  padding-bottom: 30px;
}

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-heading button {
  align-self: center;
}

.login {
  max-width: 420px;
  margin: 38px auto 0;
}

.login h1 {
  font-size: 1.55rem;
  margin-bottom: 14px;
}

.manage-layout {
  grid-template-columns: minmax(280px,1fr) minmax(0,2fr);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.section-title h2 {
  margin: 0;
}

.registered {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
}

.course-list {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.requests-list {
  margin-top: 12px;
  display: grid;
  gap: 9px;
}

.record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.record-top strong {
  overflow-wrap: anywhere;
}

.record-meta {
  color: var(--muted);
  font-size: .89rem;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.record-actions [data-action=revoke] {
  color: #8c2b25;
}

@media(max-width:830px) {
  .wrap {
    width: calc(100% - 36px);
  }
  .viewer-layout,.manage-layout {
    grid-template-columns: 1fr;
  }
  .viewer-layout .access {
    grid-row: 1;
  }
  .video-stage {
    aspect-ratio: 16/10;
  }
  .intro {
    padding: 26px 0 18px;
  }
}

.speed {
  white-space: nowrap;
  flex: none;
}

.speed select {
  width: auto;
}

@media(max-width:420px) {
  .wrap {
    width: calc(100% - 28px);
  }
  .panel {
    padding: 16px;
  }
  .intro h1 {
    font-size: 1.65rem;
  }
  .top-inner {
    min-height: 55px;
  }
  .screen-caption,.controls {
    padding-inline: 11px;
  }
  .play-actions {
    gap: 5px;
  }
  .speed {
    margin-left: 0;
  }
  .request-info {
    flex-wrap: wrap;
  }
}
