:root {
  color-scheme: dark;
  --page: #101112;
  --panel: #1a1c1e;
  --input: #131517;
  --line: #353637;
  --text: #f2efe8;
  --muted: #b0b0aa;
  --amber: #f4bb58;
  --amber-bright: #ffd48a;
  --display: "Archivo Black", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --sans: Inter, "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.65 var(--sans);
}

a { color: var(--amber); text-underline-offset: .24em; }
a:hover { color: var(--amber-bright); }

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 4px;
}

h1, h2, h3, p { margin: 0; }

.shell {
  width: min(71rem, calc(100% - 5rem));
  margin-inline: auto;
}

.site-header {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
  background: #131414;
}

.site-brand {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.brand-name { overflow-wrap: anywhere; }

.brand-symbol {
  position: relative;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--amber);
  border-radius: 4px;
  color: var(--amber);
}

.brand-symbol::before {
  content: "";
  width: .7rem;
  height: .7rem;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.brand-symbol::after {
  content: "";
  position: absolute;
  width: .22rem;
  height: .22rem;
  background: currentColor;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  font-size: .875rem;
}

.site-nav a {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--amber); }

.main-content { flex: 1 0 auto; padding-block: 3.25rem 4rem; }
.layout-public .main-content { padding-top: 1.75rem; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: 23.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: stretch;
  margin-bottom: 1.75rem;
  overflow: hidden;
  border: 1px solid #3c3830;
  border-radius: 12px;
  background: linear-gradient(116deg, #21201d, #171819 53%, #222017 100%);
}

.hero-copy {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 3.3rem clamp(1.75rem, 5vw, 4rem);
}

.hero-title {
  max-width: 20ch;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 800 clamp(2rem, 4.4vw, 4.2rem)/1.18 var(--display);
}

.hero-title-main {
  display: block;
  color: var(--amber);
  font-size: 1.26em;
  font-weight: 900;
  letter-spacing: -.035em;
}

.hero-title-detail {
  display: block;
  margin-top: .6em;
  color: var(--text);
  font-size: max(1rem, .48em);
  font-weight: 750;
  line-height: 1.48;
}

.hero-art {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, #b3965c20 1px, transparent 1px) 50% 50% / 28px 28px,
    linear-gradient(#b3965c20 1px, transparent 1px) 50% 50% / 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 30%);
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 1.75rem;
  background:
    linear-gradient(var(--amber), var(--amber)) top right / 22px 1px,
    linear-gradient(var(--amber), var(--amber)) top right / 1px 22px,
    linear-gradient(var(--amber), var(--amber)) bottom right / 22px 1px,
    linear-gradient(var(--amber), var(--amber)) bottom right / 1px 22px;
  background-repeat: no-repeat;
  opacity: .65;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 54% 50%, #a269293b, transparent 68%);
}

.hero-art-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: min(61%, 14.5rem);
  aspect-ratio: 1;
  transform: translateX(6%);
  border: 1px solid #b597614d;
  border-radius: 50%;
  background:
    linear-gradient(90deg, #e7c1735c 1px, transparent 1px) center / 1px 100% no-repeat,
    linear-gradient(#e7c1735c 1px, transparent 1px) center / 100% 1px no-repeat,
    repeating-radial-gradient(circle, transparent 0 26%, #e7c17340 26.4% 26.7%, transparent 27% 34%);
}

.hero-art-mark::before {
  content: "";
  position: absolute;
  width: 5%;
  aspect-ratio: 1;
  transform: rotate(45deg);
  background: var(--amber);
  box-shadow: 0 0 24px #f4bb58b0;
}

.hero-art-mark::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px dashed #e7c17377;
  border-radius: 50%;
}

.panel, .challenge-panel, .training-card, .training-answer {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.challenge-panel {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 3.7vw, 2.5rem);
}

.challenge-heading {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.35;
}

.challenge-heading::before {
  content: "";
  align-self: stretch;
  flex: 0 0 3px;
  border-radius: 2px;
  background: var(--amber);
}

.challenge-body {
  max-width: 64ch;
  color: var(--muted);
  white-space: pre-wrap;
  font-size: 1.02rem;
}

.challenge-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem 1.25rem;
  margin-top: .4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 2.8rem;
  max-width: 100%;
  padding: .6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 750 1rem/1.45 var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.button:hover { border-color: var(--amber); }
.button-primary { border-color: var(--amber); background: var(--amber); color: #201507; }
.button-primary:hover { background: var(--amber-bright); color: #201507; }
.button-icon { flex: 0 0 auto; }

.authorization {
  margin-top: 1.4rem;
  padding: .8rem 1rem;
  border-inline-start: 2px solid var(--amber);
  background: #201e19;
  color: var(--muted);
  font-size: .9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-footer {
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.layout-admin .main-content, .layout-training .main-content, .layout-auth .main-content {
  max-width: 56rem;
}

.panel { padding: clamp(1.25rem, 3.7vw, 2.5rem); }

.admin-head, .training-head {
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
}

.admin-head h1, .training-head h1, .layout-auth h1 {
  font: 800 clamp(1.8rem, 4vw, 2.75rem)/1.25 var(--display);
}

.admin-head p, .training-head p, .layout-auth p { margin-top: .6rem; color: var(--muted); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1rem;
}

.field { display: grid; align-content: start; gap: .35rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: .95rem; font-weight: 700; }
.field-hint { color: var(--muted); font-size: .85rem; }

input[type="text"], textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .55rem .65rem;
  border: 1px solid #686963;
  border-radius: 5px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}

textarea { resize: vertical; }
input[readonly] { color: var(--muted); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.2rem;
  margin-top: 1.5rem;
}

.notice {
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--input);
}

.notice-error { color: #ffd6cd; border-color: #875349; }
.notice-success { color: #ceefcd; border-color: #456d48; }

.training-sections { display: grid; gap: 1rem; }
.training-card, .training-answer { padding: clamp(1rem, 3vw, 1.6rem); }
.training-card h2 { font-size: 1.2rem; line-height: 1.4; }

.training-card p, .training-answer p {
  margin-top: .55rem;
  white-space: pre-wrap;
  color: var(--muted);
}

.training-answer { margin-top: 1rem; }
.training-answer .notice:last-child { margin-bottom: 0; }
.answer-choices { display: grid; gap: .65rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.answer-choices legend { margin-bottom: .8rem; padding: 0; font-weight: 700; }
.answer-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--input);
  cursor: pointer;
}
.answer-option:focus-within, .answer-option:has(:checked) { border-color: var(--amber); }
.answer-option input { flex: 0 0 auto; width: 1rem; height: 1rem; margin: .3rem 0 0; accent-color: var(--amber); }
.answer-code { max-width: 12rem; }

@media (max-width: 48rem) {
  .shell { width: calc(100% - 2.5rem); }
  .main-content { padding-block: 2rem 3rem; }
  .hero { min-height: 19rem; }
  .hero-art::before { inset: 1.25rem; }
}

@media (max-width: 32rem) {
  .shell { width: calc(100% - 1.75rem); }
  .site-header { min-height: 3.75rem; }
  .layout-public .main-content { padding-top: .9rem; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 17rem; margin-bottom: .9rem; }
  .hero-copy { padding: 2.1rem 1.2rem; }
  .hero-title { max-width: 100%; }
  .hero-title-detail { max-width: 16em; font-size: .57em; }
  .hero-art { position: absolute; inset: 0 0 0 30%; z-index: -1; opacity: .5; }
  .hero-art-mark { transform: translateX(20%); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
