:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #19253d;
  background: #f2f5fb;
  --surface: #fff;
  --foreground: #19253d;
  --muted: #52627d;
  --border: #d6dfed;
  --soft-border: #e4eaf4;
  --accent: #2551ce;
  --accent-hover: #1a3eaa;
  --accent-soft: #eef3ff;
  --focus: #2854ce;
}

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

[hidden] { display: none !important; }

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #e6edfb 0, #f2f5fb 31rem);
  line-height: 1.55;
}

a { color: var(--accent); }

button, input, select { font: inherit; }

button, select, input[type="file"] { cursor: pointer; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header {
  border-bottom: 1px solid var(--soft-border);
  background: var(--surface);
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(76rem, calc(100% - 3rem));
  min-height: 4rem;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--foreground);
  font-size: 1.075rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: .55rem;
  background: var(--accent);
}

.brand-mark::before, .brand-mark::after {
  grid-area: 1 / 1;
  width: .5rem;
  height: .875rem;
  border-radius: .125rem;
  background: white;
  content: "";
  transform: translate(-.19rem, .15rem) skew(-21deg);
}

.brand-mark::after {
  opacity: .62;
  transform: translate(.19rem, -.15rem) skew(-21deg);
}

.page { margin: clamp(1.5rem, 5vw, 3.25rem) auto 0; }

.page-registration { width: min(34rem, calc(100% - 3rem)); }

.page-admin { width: min(73rem, calc(100% - 3rem)); }

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 .65rem 2rem #273e7010;
}

.card-header, .form-body {
  padding-inline: clamp(1.2rem, 4vw, 2.25rem);
}

.card-header {
  padding-top: clamp(1.2rem, 4vw, 2rem);
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--soft-border);
}

h1, h2, p { margin: 0; }

h1 { font-size: clamp(1.55rem, 3.5vw, 2.05rem); line-height: 1.3; }

h2 { font-size: 1.25rem; line-height: 1.3; }

.form-body { padding-block: 1.45rem 1.7rem; }

.form-grid {
  display: grid;
  gap: 1.05rem;
}

.field { display: grid; gap: .4rem; min-width: 0; }

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

.hint { color: var(--muted); font-size: .875rem; }

input:not([type="file"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .59rem .78rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background-color: var(--surface);
  color: var(--foreground);
}

input:not([type="file"]):focus, select:focus { border-color: var(--focus); }

input::placeholder, select:required:invalid { color: var(--muted); opacity: 1; }

select option { color: var(--foreground); }

.select-wrap { position: relative; }

.select-wrap select { appearance: none; padding-right: 2rem; }

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: .95rem;
  width: .47rem;
  height: .47rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-76%) rotate(45deg);
}

.file-chooser {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 3.25rem;
  border: 1px dashed #9fb1d2;
  border-radius: .65rem;
  background: #f6f8fd;
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
}

.file-chooser input {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  opacity: 0;
}

.file-chooser:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

.file-chooser:hover { background: var(--accent-soft); }

.file-chooser:has(input:disabled) { opacity: .62; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: .55rem .95rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button:disabled { opacity: .62; cursor: default; }

.button-primary { background: var(--accent); color: white; }

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

.button-secondary { border-color: var(--border); background: var(--surface); color: var(--accent); }

.button-secondary:not(:disabled):hover { border-color: #9cb1e7; background: var(--accent-soft); }

.form-actions { display: flex; justify-content: end; margin-top: 1.35rem; }

.form-actions .button { min-width: 8.5rem; }

.notice {
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #f5f7fb;
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.notice-error { border-color: #edc2c3; background: #fff2f2; color: #9d252a; }

.form-body .notice { margin-top: 1rem; }

.progress-wrap { margin-top: 1rem; color: var(--muted); font-size: .875rem; }

progress { display: block; width: 100%; height: .55rem; margin-top: .35rem; accent-color: var(--accent); }

.success-view {
  display: grid;
  justify-items: center;
  gap: .7rem;
  padding: 2.1rem 1.2rem 2.5rem;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e6eeff;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}

.record-id { font-family: ui-monospace, monospace; font-size: .9rem; overflow-wrap: anywhere; }

.success-view > .button { margin-top: .35rem; }

.site-footer {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin: 1.4rem 1rem 0;
  padding-bottom: 1.4rem;
  color: var(--muted);
  font-size: .8125rem;
}

.records-header, .toolbar, .pagination, .dialog-header, .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
}

.records-status { margin: 1rem clamp(1rem, 4vw, 2.25rem); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; }

th, td { padding: .8rem 1rem; border-bottom: 1px solid var(--soft-border); white-space: nowrap; }

th:first-child, td:first-child { padding-left: clamp(1rem, 4vw, 2.25rem); }

th:last-child, td:last-child { padding-right: clamp(1rem, 4vw, 2.25rem); }

th { background: #f3f6fc; color: var(--muted); font-size: .875rem; font-weight: 650; }

td { font-size: .9rem; }

td.cell-name { max-width: 16rem; overflow-wrap: anywhere; white-space: normal; }

.cell-number { font-variant-numeric: tabular-nums; }

.cell-birth-date { display: block; }

.pagination { justify-content: end; padding: 1rem clamp(1rem, 4vw, 2.25rem); }

.pagination > .hint { padding-inline: .25rem; }

.video-dialog {
  width: min(42rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--foreground);
  background: var(--surface);
}

.video-dialog::backdrop { background: #19253d99; }

.video-dialog video {
  display: block;
  width: 100%;
  max-height: 65vh;
  min-height: 8rem;
  margin: 1rem 0;
  border-radius: .45rem;
  background: #182338;
}

.video-message { margin-bottom: .85rem; }

.video-filename { overflow-wrap: anywhere; }

@media (max-width: 37rem) {
  .site-bar, .page-registration, .page-admin { width: calc(100% - 1.5rem); }
  .form-actions .button { width: 100%; }
  .pagination { justify-content: center; }
}
