:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #efefef;
  background: #101010;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #8d8d8d;
  --line: #292929;
  --panel: rgba(25, 25, 25, .88);
  --white: #f3f3f3;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #101010; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.page-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse at 72% 18%, rgba(86, 86, 86, .12), transparent 42%),
    linear-gradient(#101010 0%, #111 72%, #101010 100%);
}
.page-glow::before, .page-glow::after {
  content: ""; position: absolute; width: 150vw; height: 42vh; left: -34vw;
  border: 1px solid rgba(160, 160, 160, .22); border-radius: 50%;
  transform: rotate(-22deg); pointer-events: none;
}
.page-glow::before {
  top: 38vh;
  box-shadow: 0 12px 0 transparent, 0 13px 0 rgba(160,160,160,.18),
    0 26px 0 transparent, 0 27px 0 rgba(160,160,160,.14),
    0 40px 0 transparent, 0 41px 0 rgba(160,160,160,.1),
    0 54px 0 transparent, 0 55px 0 rgba(160,160,160,.07);
}
.page-glow::after { top: 51vh; left: -48vw; opacity: .55; }
.topbar, main, footer { position: relative; z-index: 1; }
.topbar { z-index: 3; }
.topbar {
  height: 76px; padding: 0 max(5vw, 22px); display: flex; align-items: center;
  justify-content: space-between; gap: 24px; border-bottom: 1px solid #252525;
  background: rgba(16,16,16,.82); position: sticky; top: 0; z-index: 3; backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand b { display: block; font-size: 15px; letter-spacing: .12em; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; margin-top: 3px; }
nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 42px); }
nav a { font-size: 12px; color: #a7a7a7; transition: color .2s; }
nav a:hover, nav a.active { color: white; }
.top-actions { display: flex; align-items: center; gap: 14px; min-width: 180px; justify-content: end; }
.user-indicator { color: var(--muted); font-size: 12px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button {
  border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; font-weight: 700;
  transition: transform .18s, background .18s, border-color .18s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--white); color: #111; box-shadow: 0 8px 26px #fff2; }
.button-outline { border: 1px solid #383838; color: #eee; background: #171717; }
.button-small { padding: 9px 13px; font-size: 12px; }
main { width: min(1120px, calc(100% - 40px)); margin: 24px auto 80px; }
.hero { display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 70px; padding: 48px 0 70px; }
.eyebrow { color: #aaa; text-transform: uppercase; letter-spacing: .18em; font-size: 10px; }
h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -.055em; line-height: 1.04; margin: 18px 0; }
h2 { letter-spacing: -.04em; font-size: clamp(28px, 4vw, 42px); margin: 0 0 14px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { color: #aaa; line-height: 1.7; }
.hero-copy { max-width: 570px; }
.hero-copy > p { max-width: 480px; font-size: 15px; }
.hero-buttons { display: flex; gap: 12px; margin-top: 27px; flex-wrap: wrap; }
.hero-art { border: 1px solid #34312c; background: radial-gradient(ellipse at 50% 42%, rgba(194,145,82,.16), transparent 44%), linear-gradient(145deg,#24221f,#151515 68%); border-radius: 24px; min-height: 350px; display: grid; place-items: center; position: relative; overflow: hidden; }
.hero-art:before { content: ""; position: absolute; width: 72%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(208,170,112,.08), transparent 70%); }
.hero-art:after { content: ""; position: absolute; inset: 16px; border: 1px solid rgba(190,170,140,.08); border-radius: 17px; }
.hero-art img { width: min(58%, 210px); filter: drop-shadow(0 20px 34px #000); position: relative; z-index: 1; }
.stats, .grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(3, 1fr); margin: 16px 0 70px; }
.grid { grid-template-columns: repeat(3, 1fr); }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 23px; }
.stat strong { font-size: 25px; display: block; margin-bottom: 5px; }
.stat span, .muted { color: var(--muted); font-size: 12px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 56px 0 20px; }
.section-head h2 { margin: 0; font-size: 30px; }
.card p { font-size: 13px; margin-bottom: 16px; }
.card-link { display: inline-flex; color: #eee; font-size: 12px; font-weight: 700; margin-top: 10px; }
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.roster li:first-child { border-top: 0; }
.lesson-list { display: grid; gap: 12px; }
.lesson-card summary, .promotion-rule summary { cursor: pointer; }
.lesson-content { white-space: pre-wrap; }
.lesson-preview { width: 100%; min-height: 520px; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lesson-image { display: block; max-width: min(100%, 720px); max-height: 560px; object-fit: contain; margin: 14px 0; border-radius: 10px; }
.presentation-preview { margin-top: 14px; }
.presentation-preview iframe { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: 10px; }
.promotion-card, .promotion-settings { margin-top: 24px; }
.promotion-division-list { display: grid; gap: 12px; margin-top: 18px; }
.promotion-division { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.promotion-division > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; background: #202020; cursor: pointer; list-style-position: inside; }
.promotion-division-content { padding: 16px; }
.promotion-exams-form { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.promotion-exams-form h4, .promotion-division-content > h4 { margin: 4px 0 10px; }
.promotion-exam-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 12px; margin-bottom: 12px; }
.promotion-exam-list .answer { align-items: center; margin: 0; }
.promotion-rank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.promotion-rule { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.promotion-rule-form { padding-top: 10px; }
.report-preview { display: block; width: 100%; min-height: 280px; margin: 12px 0; color: #eee; background: #202020; border: 1px solid #3a3a3a; border-radius: 9px; padding: 13px; resize: vertical; }
.exam-notice { margin-top: 20px; border-color: #554333; }
.icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #3a3a3a; background: #202020; border-radius: 11px; color: #ddd; margin-bottom: 18px; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.auth-screen { min-height: 70vh; display: grid; place-items: center; padding: 35px 0; }
.auth-card { width: min(430px, 100%); background: #181818ed; border: 1px solid #303030; border-radius: 18px; padding: 28px; box-shadow: 0 20px 80px #0008; }
.auth-card h2 { text-align: center; font-size: 26px; }
.switcher { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #101010; border: 1px solid #2a2a2a; border-radius: 10px; margin: 20px 0 24px; }
.switcher button { background: transparent; color: #888; border: 0; border-radius: 7px; padding: 10px; cursor: pointer; }
.switcher button.selected { background: #292929; color: white; }
.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 10px; font-weight: 700; color: #999; letter-spacing: .1em; margin-bottom: 8px; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; color: #eee; background: #202020; border: 1px solid #3a3a3a; border-radius: 9px; padding: 13px; outline: none; }
.field input:focus, .field textarea:focus { border-color: #888; }
.field textarea { min-height: 140px; resize: vertical; }
.auth-card .button { width: 100%; margin-top: 14px; }
.message { color: #d7b6a8; background: #38231e; padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-top: 12px; }
.success { color: #b7d9be; background: #203125; }
.code-list { font: 600 12px ui-monospace, monospace; line-height: 2; word-break: break-word; color: #d9d3c4; }
.process-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 16px 0; }
.process-row:first-child { border-top: 0; }
.progress { height: 5px; background: #333; border-radius: 10px; overflow: hidden; margin: 14px 0; }
.progress i { display: block; height: 100%; background: #eee; }
.badge { border: 1px solid #444; color: #bbb; border-radius: 999px; padding: 5px 9px; font-size: 10px; white-space: nowrap; }
.question { margin: 18px 0; }
.answer { display: flex; gap: 10px; align-items: flex-start; background: #202020; border: 1px solid #383838; padding: 13px; border-radius: 10px; margin: 8px 0; cursor: pointer; font-size: 13px; }
.answer:has(input:checked) { border-color: #aaa; background: #292929; }
footer { border-top: 1px solid #292929; color: #777; padding: 25px max(5vw, 22px); display: flex; justify-content: space-between; font-size: 11px; }
dialog { color: #eee; background: #161616; border: 1px solid #373737; border-radius: 17px; width: min(460px, calc(100% - 28px)); padding: 0; }
dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.dialog-close { display: flex; justify-content: end; padding: 8px 12px 0; }
.dialog-close button { background: transparent; color: #aaa; border: 0; font-size: 24px; cursor: pointer; }
.dialog-inner { padding: 0 28px 28px; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.table-filters .field { margin: 0; }
.table-record { margin: 12px 0; }
.table-record summary { cursor: pointer; list-style-position: inside; }
.table-record summary .badge { float: right; }
.table-process-form { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; }
.table-process-form h4 { margin: 18px 0 4px; }
.table-records { margin: 14px 0; }
@media (max-width: 760px) {
  .topbar { height: auto; padding: 13px 18px; flex-wrap: wrap; gap: 12px; }
  .brand { min-width: auto; }
  nav { order: 3; width: 100%; overflow-x: auto; padding: 7px 0 2px; gap: 22px; }
  nav a { white-space: nowrap; }
  .top-actions { min-width: auto; margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 18px 0 45px; }
  .hero-art { min-height: 260px; }
  .stats, .grid { grid-template-columns: 1fr; }
  .stats { gap: 9px; margin-bottom: 50px; }
  .stat { display: flex; justify-content: space-between; align-items: center; }
  .stat strong { margin: 0; font-size: 20px; }
  .section-head { align-items: start; flex-direction: column; }
  .promotion-division > summary { align-items: flex-start; flex-direction: column; }
  .promotion-rank-list { grid-template-columns: 1fr; }
  main { width: min(100% - 28px, 1120px); }
  footer { gap: 12px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
