/* 온라인 시험·기록 화면, 공용 대화창 */

body.app-page { display: block; background: #f4f5f7; min-height: 100vh; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: #c0392b; font-size: 13px; min-height: 1em; margin: 6px 0; }
.ok { color: #1e7d4f; font-size: 13px; min-height: 1em; margin: 6px 0; }
.warn { color: #b45309; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.btn:hover { filter: brightness(0.97); }
button.outline { background: #fff; border-color: var(--accent); color: var(--accent); font-weight: 700; }
button.danger { color: #c0392b; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-btns button, .row-btns .btn { width: auto; margin: 0; }
.nav-link { display: inline-block; margin: -8px 0 16px; font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }
.nav-link:hover { text-decoration: underline; }

/* 대화창 */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 22, 28, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog {
  width: min(440px, 100%); background: #fff; border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.dialog h2 { margin: 0 0 6px; font-size: 18px; }
.dialog p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; }
.dialog input { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.dialog button.primary { margin: 6px 0 0; }
.link-row { display: flex; gap: 6px; }
.link-row input { font-size: 13px; }
.link-row button { width: auto; margin: 0; flex: none; }

/* ───────── 학생: 온라인 시험 ───────── */
.t-wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.t-head h1 { font-size: 22px; margin: 4px 0 6px; letter-spacing: -0.02em; }
.t-head p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.score { font-size: 18px; margin: 6px 0; }
.score b { font-size: 40px; color: var(--accent); }
.t-list { list-style: none; padding: 0; margin: 16px 0 0; }
.t-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 16px 14px; margin-bottom: 12px; font-size: 16px; line-height: 1.7;
}
.t-card.is-ok { border-left: 5px solid #2e9e6a; }
.t-card.is-ng { border-left: 5px solid #d9534f; }
.t-num {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px;
  color: #fff; background: var(--ink); border-radius: 12px; padding: 1px 10px; margin-bottom: 6px;
}
.t-num .tag { color: #fff; border-color: #fff; }
.t-card .q-text { word-break: keep-all; }
.t-fig { margin: 8px 0 4px; text-align: center; }
.t-fig svg { width: min(100%, 320px); height: auto; }
.t-input { display: flex; gap: 6px; margin-top: 10px; }
.t-input input {
  flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px;
}
.t-input input:focus { outline: none; border-color: var(--accent); }
.t-input .sym { width: 46px; flex: none; margin: 0; font-size: 18px; padding: 0; }
.t-preview { min-height: 1.6em; margin-top: 6px; font-size: 14px; color: #333; }
.t-submit { margin-top: 18px; }
.t-submit button { font-size: 16px; padding: 14px; }
.mark { position: absolute; top: 12px; right: 14px; font-size: 22px; }
.t-ans { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 4px; padding: 8px 10px; background: #f6f7f9; border-radius: 8px; font-size: 15px; }
.t-sol { margin-top: 8px; padding: 10px 12px; background: #fff6f5; border-radius: 8px; font-size: 14.5px; }
.t-sol b { display: block; font-size: 13px; color: #b23b36; margin-bottom: 2px; }
.t-card details { margin-top: 6px; font-size: 14.5px; }
.t-card summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.t-empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ───────── 선생님: 기록·오답 노트 ───────── */
.r-wrap { max-width: 1100px; margin: 0 auto; padding: 22px 20px 60px; }
.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.r-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.r-head p { margin: 4px 0 0; font-size: 13.5px; }
.r-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12.5px; color: var(--muted); }
.r-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.r-card h2 { margin: 0 0 6px; font-size: 16px; }
.r-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.exam { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.exam input { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.recs { list-style: none; padding: 0; margin: 8px 0 0; }
.rec { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; }
.rec h3 { margin: 0 0 3px; font-size: 15px; }
.rec p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #444; }
.rec button { width: auto; flex: none; margin: 0; }
.rec-review h3::before { content: "● "; color: #d9534f; }
.rec-basics h3::before { content: "● "; color: #e08a00; }
.rec-exam h3::before { content: "● "; color: var(--accent); }
.rec-diagnose h3::before, .rec-start h3::before { content: "● "; color: #6b7079; }
.rec-mastered h3::before { content: "● "; color: #2e9e6a; }
.r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.unit-title { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.c-row { display: grid; grid-template-columns: 1fr auto 90px 120px; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.c-num { font-size: 12px; color: var(--muted); text-align: right; }
.chip { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.s-weak { background: #fde8e7; color: #b23b36; }
.s-mid { background: #fff3d6; color: #9a6400; }
.s-good { background: #e3f4ea; color: #1e7d4f; }
.s-none { background: #eef0f3; color: #6b7079; }
.bar { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.wrong { list-style: none; padding: 0; margin: 6px 0 0; }
.w-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.w-row:first-child { border-top: 0; }
.w-main { line-height: 1.7; }
.w-btns { display: flex; gap: 6px; margin-top: 6px; }
.w-btns button { width: auto; margin: 0; padding: 5px 10px; font-size: 12.5px; }
.w-detail { margin-top: 8px; padding: 10px 12px; background: #f6f7f9; border-radius: 8px; font-size: 14px; line-height: 1.7; }
.tests { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tests th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tests td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.t-btns { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.t-btns button, .t-btns .btn { width: auto; margin: 0; padding: 4px 9px; font-size: 12.5px; }

@media (max-width: 760px) {
  .r-summary { grid-template-columns: 1fr 1fr; }
  .r-grid { grid-template-columns: 1fr; }
  .c-row { grid-template-columns: 1fr auto 60px; }
  .c-num { grid-column: 1 / -1; text-align: left; }
  .rec { flex-direction: column; align-items: stretch; }
}
@media print { .overlay { display: none; } }
