/* KNN 프로젝트 공용 스타일 — 크롬북(16:9)·전자칠판 기준, 큰 글씨, 모던·포멀 */
:root {
  --ink: #1e293b;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --brand: #4f46e5;
  --brand-soft: #eef2ff;
  --brand-deep: #3730a3;
  --accent: #0ea5e9;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 17px; }
body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* 상단 바 */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo { font-weight: 800; font-size: 1.15rem; color: var(--brand-deep); text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .badge {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  font-weight: 700;
  font-size: 0.95rem;
}

/* 차시 탭 */
.tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1.4rem 0;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.tab-btn {
  border: 1px solid var(--line);
  border-bottom: none;
  background: #e8edf4;
  color: var(--ink-soft);
  padding: 0.55rem 1.1rem;
  border-radius: 10px 10px 0 0;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}
.tab-btn.active { background: var(--card); color: var(--brand-deep); border-color: var(--brand); border-bottom: 3px solid var(--card); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.4rem 3rem; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 1.6rem 1.8rem;
}

h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.8rem; color: var(--brand-deep); }
h3 { font-size: 1.1rem; margin: 1.2rem 0 0.5rem; }
p.lead { color: var(--ink-soft); margin-bottom: 1rem; }

/* 카드 그리드 */
.grid { display: grid; gap: 0.9rem; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); }
}
.mini-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fafcff;
}
.mini-card.selectable { cursor: pointer; transition: all 0.15s; user-select: none; text-align: center; }
.mini-card.selectable:hover { border-color: var(--accent); transform: translateY(-2px); }
.mini-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.mini-card .emoji { font-size: 2.2rem; display: block; margin-bottom: 0.3rem; }

/* 설문 */
.q-item { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
.q-item .q-text { font-weight: 700; font-size: 1.08rem; margin-bottom: 0.5rem; }
.likert { display: flex; gap: 0.5rem; }
.likert button {
  flex: 1;
  padding: 0.55rem 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.likert button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 버튼 */
.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.6rem;
  font-size: 1.08rem;
  font-weight: 800;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-deep); }
.btn.ghost { background: var(--card); color: var(--brand-deep); border: 1.5px solid var(--brand); }
.btn.small { padding: 0.45rem 1rem; font-size: 0.95rem; }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }

/* 입력 */
.field { margin-bottom: 0.9rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

/* 결과 박스 */
.result-box {
  background: var(--brand-soft);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-top: 1rem;
}
.notice { background: #fffbeb; border: 1.5px solid var(--warn); border-radius: 10px; padding: 0.7rem 1rem; margin: 0.8rem 0; }
.hint { color: var(--ink-soft); font-size: 0.95rem; }

/* 표 */
table.data { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 0.45rem 0.7rem; text-align: center; font-size: 0.98rem; }
table.data th { background: var(--brand-soft); color: var(--brand-deep); }
table.data tr.hl { background: #ecfdf5; font-weight: 700; }

/* 캔버스 */
canvas.board { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; touch-action: none; }

/* 상태 카드(감정) */
.state-card { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 999px; padding: 0.35rem 1rem; font-weight: 800; font-size: 1.05rem; }
.state-green { background: #dcfce7; color: #166534; }
.state-yellow { background: #fef9c3; color: #854d0e; }
.state-blue { background: #dbeafe; color: #1e40af; }

/* 단계 진행 */
.steps { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.step-chip { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 0.25rem 0.9rem; font-weight: 700; font-size: 0.92rem; color: var(--ink-soft); }
.step-chip.done { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }

/* 로딩 점 */
.loading::after { content: "…"; animation: dots 1.2s infinite; }
@keyframes dots { 0% { content: "."; } 33% { content: ".."; } 66% { content: "..."; } }

/* 랜딩 */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; gap: 1.2rem; }
.landing h1 { font-size: 2.3rem; text-align: center; }
.landing .sub { color: var(--ink-soft); font-size: 1.15rem; text-align: center; }
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; max-width: 1000px; width: 100%; margin-top: 1rem; }
@media (max-width: 800px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 2rem 1.6rem;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  transition: all 0.15s;
}
.entry-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12); }
.entry-card .big { font-size: 2.6rem; display: block; margin-bottom: 0.6rem; }
.entry-card h2 { margin: 0 0 0.4rem; }
.entry-card p { color: var(--ink-soft); font-size: 0.98rem; }

/* 연구회 로고·푸터 (전 페이지 공통) */
.topbar-logo { height: 38px; margin-right: 0.55rem; flex: none; }
.site-footer { margin: 2.6rem auto 0; padding: 1.6rem 1rem 2.2rem; border-top: 1px solid var(--line); text-align: center; width: 100%; max-width: 1000px; }
.site-footer img { height: 86px; opacity: 0.92; }
.site-footer p { color: var(--ink-soft); font-size: 0.88rem; margin-top: 0.6rem; }

/* 랜딩 — 공통 게임 배너 */
.game-banner {
  max-width: 1000px; width: 100%; margin-top: 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fcd34d; border-radius: 18px;
  padding: 1.1rem 1.5rem; text-decoration: none; color: var(--ink); transition: all 0.15s;
}
.game-banner:hover { border-color: #f59e0b; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(245, 158, 11, 0.18); }
.gb-emoji { font-size: 2.2rem; }
.gb-text { flex: 1; }
.gb-text b { font-size: 1.15rem; }
.gb-text small { display: block; color: var(--ink-soft); margin-top: 0.15rem; }
.gb-tag { background: #f59e0b; color: #fff; font-size: 0.75rem; font-weight: 800; padding: 0.18rem 0.6rem; border-radius: 999px; vertical-align: 2px; margin-left: 0.3rem; }
.gb-go { font-weight: 800; color: #b45309; white-space: nowrap; }

/* 랜딩 — 참관·연수용 데모 박스 */
.demo-box {
  max-width: 1000px; width: 100%; margin-top: 1.6rem;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
  border: 1.5px solid #ddd6fe; border-radius: 18px;
  padding: 1.3rem 1.5rem;
}
.demo-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.demo-head strong { font-size: 1.05rem; }
.demo-badge {
  background: #7c3aed; color: #fff; font-weight: 800; font-size: 0.8rem;
  padding: 0.28rem 0.75rem; border-radius: 999px; letter-spacing: 0.04em; white-space: nowrap;
}
.demo-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1rem; }
@media (max-width: 800px) { .demo-links { grid-template-columns: 1fr; } }
.demo-links a {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fff; border: 1.5px solid #ddd6fe; border-radius: 12px;
  padding: 0.8rem 1rem; text-decoration: none; color: var(--ink); transition: all 0.15s;
}
.demo-links a:hover { border-color: #7c3aed; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(124, 58, 237, 0.14); }
.demo-links a > span { font-size: 1.6rem; }
.demo-links a b { display: block; font-size: 0.98rem; }
.demo-links a small { display: block; color: var(--ink-soft); font-size: 0.82rem; margin-top: 0.1rem; }

/* 랜딩 — 연구 소개(2026 국제교육포럼) */
.research-box {
  max-width: 1000px; width: 100%; margin-top: 1.6rem;
  background: var(--card);
  border: 1.5px solid var(--line); border-radius: 18px;
  padding: 1.3rem 1.5rem;
}
.research-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.research-head strong { font-size: 1.05rem; }
.research-head .hint { width: 100%; }
.research-badge {
  background: var(--brand-deep); color: #fff; font-weight: 800; font-size: 0.8rem;
  padding: 0.28rem 0.75rem; border-radius: 999px; letter-spacing: 0.04em; white-space: nowrap;
}
.research-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1rem; }
@media (max-width: 800px) { .research-steps { grid-template-columns: 1fr; } }
.research-step { border: 1.5px solid var(--line); border-radius: 12px; padding: 0.75rem 0.9rem; background: #fafcff; }
.research-step p { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.35rem; line-height: 1.45; }
.rs-top { display: flex; align-items: center; gap: 0.5rem; }
.rs-num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.rs-top b { color: var(--brand-deep); font-size: 0.98rem; }
.rs-tag { margin-left: auto; background: var(--bg); color: var(--ink-soft); font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }

/* 챗 */
.chat-box { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; height: 380px; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-msg { max-width: 80%; padding: 0.6rem 0.9rem; border-radius: 14px; font-size: 1rem; }
.chat-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; white-space: pre-wrap; }
.chat-input { display: flex; gap: 0.5rem; border-top: 1px solid var(--line); padding: 0.6rem; }
.chat-input input { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 0.55rem 0.8rem; }
