/* 서울기록원 시청각 기록 기반 인공지능 안면인식 프로그램 웹판 공통 스타일.
   원래 프로그램(PyQt, 2023)의 정체성을 잇는다: 어두운 바탕(#0D0F10·#131619), 하늘색 주 동작(#82DBF7),
   왼쪽 메뉴 세 개의 도형 색(빨강 삼각형 AI 안면인식 · 주황 사각형 AI 모델 학습 · 하늘색 원 AI 모델 검증),
   대상 인물 빨간 상자 + 이름표, 그 밖의 얼굴 초록 상자. 그림에 새겨 넣던 글자는 모두 화면 요소로 다시 만들었다. */
@font-face { font-family: "Pretendard"; src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920; font-display: swap; }

:root {
  --bg: #0b0d0f;
  --bg-2: #0f1215;
  --panel: #13171b;
  --panel-2: #181d22;
  --panel-3: #1e242a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #e9edf1;
  --text-2: #b4bec8;
  --text-3: #7d8893;
  --sky: #82dbf7;
  --sky-strong: #4cc3eb;
  --sky-soft: rgba(130, 219, 247, .12);
  --sky-ink: #06222b;
  --red: #e5484d;
  --red-mark: #d0302f;
  --red-soft: rgba(229, 72, 77, .14);
  --orange: #e26f20;
  --green: #46c37b;
  --green-soft: rgba(70, 195, 123, .14);
  --yellow: #f5d061;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--sky); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(130, 219, 247, .3); }
.num, .tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* 스크롤바: 원래 프로그램의 얇은 막대(트랙 밝은 회색·손잡이 회색)를 어두운 바탕에 맞춤 */
* { scrollbar-width: thin; scrollbar-color: #3a434c transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #3a434c; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------------------------------------------------------------- 틀: 왼쪽 메뉴 + 본문 */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px 18px;
  background: linear-gradient(180deg, #101317 0%, #0c0e11 100%); border-right: 1px solid var(--line); }
.side .prog { padding: 6px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side .prog .k { font-size: 11px; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.side .prog .t { font-size: 14px; font-weight: 700; line-height: 1.45; margin-top: 4px; color: var(--text); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600;
  font-size: 15px; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav a.on { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: currentColor; }
.nav a.on.intro::before { background: var(--red-mark); }
.nav a.on.train::before { background: var(--orange); }
.nav a.on.validate::before { background: var(--sky); }
.nav .ic { width: 18px; height: 18px; flex: none; }
.side-train { display: grid; gap: 8px; margin: 10px 2px 0; padding: 11px 12px; border-radius: 11px; background: rgba(226, 111, 32, .07);
  border: 1px solid rgba(226, 111, 32, .3); color: var(--text-2); font-size: 12.5px; }
.side-train:hover { background: rgba(226, 111, 32, .12); }
.side-train .st-top { display: flex; align-items: center; gap: 8px; }
.side-train .st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse 1.4s ease-in-out infinite; }
.side-train .st-k { font-weight: 650; color: var(--text); }
.side-train .st-v { margin-left: auto; color: #fff; font-weight: 700; }
.side-train .st-bar { height: 4px; border-radius: 4px; background: #2a3239; overflow: hidden; }
.side-train .st-bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .4s var(--ease); }
.side .grow { flex: 1; }
.side .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: 12.5px; }
.side .who button { background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 10px; color: var(--text-2); cursor: pointer; font-size: 12px; }
.side .who button:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
.side .org { padding: 14px 10px 0; opacity: .92; }
.side .org img { width: 132px; display: block; }
.side .org small { display: block; margin-top: 8px; color: var(--text-3); font-size: 11px; line-height: 1.5; }

.main { min-width: 0; padding: 24px 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 26px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.head h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; }
.head h1 .step { font-size: 15px; font-weight: 600; color: var(--text-2); margin-left: 12px; letter-spacing: 0; }
.head p { margin: 6px 0 0; color: var(--text-3); font-size: 13.5px; }
.head .meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.fs-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: grid;
  place-items: center; cursor: pointer; flex: none; }
.fs-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .22); }
.fs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fs-btn .off, .fs-btn[aria-pressed="true"] .on { display: none; }
.fs-btn[aria-pressed="true"] .off { display: block; }

/* 학습 단계 표시(① 학습 데이터 구성 → ② 변수 설정·학습) */
.steps { display: flex; gap: 6px; }
.steps a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-3); border: 1px solid var(--line); }
.steps a b { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; background: var(--panel-3); color: var(--text-2); }
.steps a.on { color: #fff; border-color: rgba(226, 111, 32, .45); background: rgba(226, 111, 32, .08); }
.steps a.on b { background: var(--orange); color: #fff; }

.grid2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card > h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card > h2 .sub { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.muted { color: var(--text-3); }
.hint { color: var(--text-3); font-size: 12.5px; line-height: 1.6; margin: 4px 0 0; }

/* ---------------------------------------------------------------- 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text); font-weight: 650; cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s; white-space: nowrap; }
.btn:hover { background: #262d34; border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--sky); border-color: var(--sky); color: var(--sky-ink); }
.btn.primary:hover { background: #9be4fa; border-color: #9be4fa; }
.btn.danger { color: #ffb4b6; border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .08); }
.btn.ghost { background: transparent; }
.btn.lg { min-height: 50px; font-size: 16px; border-radius: 12px; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn .ic { width: 16px; height: 16px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: #7ee2a4; border-color: rgba(70, 195, 123, .3); }
.chip.bad { background: var(--red-soft); color: #ff9a9d; border-color: rgba(229, 72, 77, .3); }
.chip.na { color: var(--text-3); }
.chip.sky { background: var(--sky-soft); color: var(--sky); border-color: rgba(130, 219, 247, .3); }
.chip.warn { background: rgba(245, 208, 97, .12); color: var(--yellow); border-color: rgba(245, 208, 97, .3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------------------------------------------------------- 메시지·확인 창·로딩 */
.toast-wrap { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 8px; z-index: 90; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: #20262c; border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45); font-size: 13.5px; animation: rise .22s var(--ease); display: flex; align-items: flex-start; gap: 10px; }
.toast > span { flex: 1; white-space: pre-line; }
.toast .x { flex: none; width: 22px; height: 22px; margin: -1px -6px 0 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-3);
  display: grid; place-items: center; cursor: pointer; }
.toast .x:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.toast .x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.toast.err { border-color: rgba(229, 72, 77, .45); }
.toast.ok { border-color: rgba(70, 195, 123, .45); }
.modal-back { position: fixed; inset: 0; background: rgba(4, 6, 8, .66); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 80;
  padding: 24px; animation: fade .18s ease-out; }
.modal { width: min(460px, 100%); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px 22px 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .22s var(--ease); }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0; color: var(--text-2); white-space: pre-line; }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--sky); animation: spin .8s linear infinite; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11, 13, 15, .55); border-radius: inherit; z-index: 5; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- 폼 요소 */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.seg button:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.seg button.on { background: var(--sky); color: var(--sky-ink); }
.seg button[disabled] { opacity: .45; cursor: not-allowed; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--sky) var(--p, 50%), #2a3239 var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: #2a3239; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--sky); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff;
  border: 3px solid var(--sky); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--sky); }
input[type=range]:disabled { opacity: .45; cursor: not-allowed; }
input[type=range]:disabled::-webkit-slider-runnable-track { background: linear-gradient(90deg, #5f7b86 var(--p, 50%), #2a3239 var(--p, 50%)); }
input[type=range]:disabled::-webkit-slider-thumb { border-color: #5f7b86; }
select.sel { min-height: 36px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-3)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b4bec8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; cursor: pointer; }
.bar { height: 10px; border-radius: 10px; background: #232a31; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sky-strong), var(--sky)); transition: width .4s var(--ease); }

/* 표(학습 기록·검증 결과·전거 카드) */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 650; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }

@media (max-width: 1180px) { :root { --side: 216px; } .main { padding: 20px; } .grid2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
