/* 지구 온 초등신문과 같은 색·글꼴 */
:root {
  --ground: #FBF6EC; --surface: #FFFFFF; --surface-2: #F4EDDC;
  --ink: #26333B; --ink-soft: #43535C; --muted: #837A67; --line: #E6DBC3;
  --sky: #2C7CB8; --sky-tint: #E3F0F9;
  --leaf: #35935F; --leaf-tint: #E1F0E7;
  --sun: #C7860F; --sun-tint: #FAEEC9;
  --indigo: #5A5FAE; --indigo-tint: #E8E8F7;
  --rose: #C7546C; --rose-tint: #FBE4E9;
  --coral: #D4623A;
  --kakao: #FEE500; --kakao-ink: #191919;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #141E26; --surface: #1E2C36; --surface-2: #26343E;
    --ink: #EFE7D6; --ink-soft: #CBC3B2; --muted: #A79E8B; --line: #33414B;
    --sky: #63AEE0; --sky-tint: #1B3A4C; --leaf: #64C08F; --leaf-tint: #1D3A2D;
    --sun: #EEBB57; --sun-tint: #3A3320; --indigo: #A0A4E9; --indigo-tint: #2B2C49;
    --rose: #EA8CA0; --rose-tint: #3D2830; --coral: #EC8A5F;
  }
}
:root[data-theme="dark"] {
  --ground: #141E26; --surface: #1E2C36; --surface-2: #26343E;
  --ink: #EFE7D6; --ink-soft: #CBC3B2; --muted: #A79E8B; --line: #33414B;
  --sky: #63AEE0; --sky-tint: #1B3A4C; --leaf: #64C08F; --leaf-tint: #1D3A2D;
  --sun: #EEBB57; --sun-tint: #3A3320; --indigo: #A0A4E9; --indigo-tint: #2B2C49;
  --rose: #EA8CA0; --rose-tint: #3D2830; --coral: #EC8A5F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.8;
}
h1, h2, h3, .jua { font-family: "Jua", sans-serif; font-weight: 400; }

/* ----- 위쪽 머리 ----- */
.topbar {
  max-width: 820px; margin: 0 auto; padding: 18px 16px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: "Jua", sans-serif; font-size: 1.45rem; line-height: 1.1; }
.brand-sub { display: block; font-family: "Gowun Dodum", sans-serif; font-size: .8rem; color: var(--muted); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  font-family: "Jua", sans-serif; font-size: .92rem; text-decoration: none;
  color: var(--ink-soft); padding: 5px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.nav a.active { background: var(--sky); border-color: var(--sky); color: #fff; }
.nav a:hover:not(.active) { border-color: var(--sky); color: var(--sky); }

main { max-width: 820px; margin: 0 auto; padding: 12px 16px 60px; }

/* 사이트를 올린 곳(Netlify)이 자동으로 붙이는 "Powered by Netlify" 표시가 글자를 가려서 숨겨요 */
#nl-badge-frame, #nl-hud-frame { display: none !important; }

/* ----- 카드 ----- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px clamp(16px, 4vw, 28px); margin-bottom: 16px;
}
.card h2 { margin: 0 0 6px; font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.35; }
.muted { color: var(--muted); }
.slide-tag { font-family: "Jua", sans-serif; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.slide-tag .no { color: var(--sky); }

/* ----- 진행 막대 + 단계 ----- */
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--sky); transition: width .35s ease; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span {
  font-family: "Jua", sans-serif; font-size: .8rem; padding: 2px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.steps span.done { background: var(--leaf-tint); color: var(--leaf); }
.steps span.now { background: var(--sky-tint); color: var(--sky); }
.steps span.can { cursor: pointer; box-shadow: inset 0 0 0 1px currentColor; }
.steps span.can:hover, .steps span:focus-visible { text-decoration: underline; outline: none; }
#thinkInput.editing { border-color: var(--coral); box-shadow: 0 0 0 3px var(--sun-tint); }
#editThink { margin-top: 6px; }

/* ----- 버튼 / 입력 ----- */
.btn {
  display: block; width: 100%; margin-top: 14px; border: 0; cursor: pointer;
  font-family: "Jua", sans-serif; font-size: 1.08rem; padding: 13px 22px; border-radius: 14px;
  background: var(--sky); color: #fff; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.kakao { background: var(--kakao); color: var(--kakao-ink); }
.btn.ghost { background: var(--surface-2); color: var(--ink-soft); }

input[type="text"], input[type="password"], textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--ground); color: var(--ink);
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus { outline: none; border-color: var(--sky); }
textarea { min-height: 120px; resize: vertical; }

/* ----- 신문 ----- */
.news-frame {
  width: 100%; height: 72vh; min-height: 460px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--ground);
}

/* 이야기 나눠요 느낌의 질문 */
.talk { border-left: 3px solid var(--coral); padding-left: .85rem; margin: 8px 0 12px; }
.talk-label { display: block; font-family: "Jua", sans-serif; font-size: .8rem; color: var(--coral); }

/* ----- 퀴즈 ----- */
.question { font-family: "Jua", sans-serif; font-size: 1.08rem; margin: 20px 0 8px; }
.hanja-box {
  background: var(--surface-2); border-radius: 14px; padding: 10px; text-align: center; margin: 8px 0;
}
.hanja-big { font-size: 5rem; line-height: 1.25; font-family: "Batang", "Noto Serif KR", serif; color: var(--sky); }
.choices { display: grid; gap: 8px; }
@media (min-width: 560px) { .choices.grid2 { grid-template-columns: 1fr 1fr; } }
.choice {
  font: inherit; text-align: left; padding: 11px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.choice:hover:not(:disabled) { border-color: var(--sky); }
.choice.correct { border-color: var(--leaf); background: var(--leaf-tint); }
.choice.wrong { border-color: var(--rose); background: var(--rose-tint); }
.choice:disabled { cursor: default; }
.feedback { font-family: "Jua", sans-serif; margin-top: 6px; min-height: 1.6em; }
.feedback.ok { color: var(--leaf); }
.feedback.no { color: var(--rose); }

/* ----- 완료 ----- */
.done-emoji { font-size: 3.6rem; text-align: center; line-height: 1.2; }
.score-row { display: flex; gap: 10px; margin: 14px 0; }
.score { flex: 1; text-align: center; background: var(--sky-tint); border-radius: 12px; padding: 10px 6px; color: var(--ink-soft); }
.score b { display: block; font-family: "Jua", sans-serif; font-weight: 400; font-size: 1.6rem; color: var(--sky); }
.score.leaf { background: var(--leaf-tint); } .score.leaf b { color: var(--leaf); }
.score.sun { background: var(--sun-tint); } .score.sun b { color: var(--sun); }
.badge-box {
  text-align: center; background: var(--sun-tint); color: var(--sun);
  border-radius: 12px; padding: 10px; font-family: "Jua", sans-serif;
}
.preview {
  white-space: pre-wrap; background: var(--surface-2); color: var(--ink-soft); border-radius: 12px;
  padding: 12px 14px; font-size: .92rem; margin-top: 12px; line-height: 1.7;
}
.preview-label { font-family: "Jua", sans-serif; font-size: .8rem; color: var(--sky); display: block; margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 10px 18px; border-radius: 999px;
  font-size: .92rem; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: .95; }

/* ----- 목록 (보관함 / 입시정보) ----- */
.list-item {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px;
}
a.list-item:hover { border-color: var(--sky); }
.list-item .date { color: var(--muted); font-size: .85rem; margin-left: 4px; }
.list-item h3 { margin: 4px 0 4px; font-size: 1.2rem; line-height: 1.4; }
.list-item p { margin: 0; color: var(--ink-soft); }
.tag {
  display: inline-block; font-family: "Jua", sans-serif; font-size: .78rem; padding: 1px 10px;
  border-radius: 999px; background: var(--sky-tint); color: var(--sky); margin-right: 4px;
}
.tag.leaf { background: var(--leaf-tint); color: var(--leaf); }
.tag.sun { background: var(--sun-tint); color: var(--sun); }
.tag.indigo { background: var(--indigo-tint); color: var(--indigo); }
.tag.rose { background: var(--rose-tint); color: var(--rose); }
.tag.muted { background: var(--surface-2); color: var(--muted); }
.ask { margin-top: 10px; border-left: 3px solid var(--coral); padding-left: .85rem; font-size: .95rem; }
.ask b { font-family: "Jua", sans-serif; font-weight: 400; color: var(--coral); display: block; font-size: .8rem; }
/* 입시정보 자세히 */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 12px 0 0; font-size: .95rem; }
.facts dt { font-family: "Jua", sans-serif; color: var(--sky); }
.facts dd { margin: 0; color: var(--ink); }
.points { margin: 10px 0 0; padding-left: 1.2rem; color: var(--ink-soft); font-size: .95rem; }
.points li { margin-bottom: 2px; }
.todo { margin-top: 10px; background: var(--leaf-tint); border-radius: 10px; padding: 8px 12px; font-size: .95rem; }
.todo b { display: block; font-family: "Jua", sans-serif; font-weight: 400; color: var(--leaf); font-size: .82rem; }
.source-link { display: inline-block; margin-top: 10px; font-family: "Jua", sans-serif; font-size: .85rem; color: var(--sky); text-decoration: none; }
.source-link:hover { text-decoration: underline; }

.think-slide-hint {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--sun-tint);
  border-left: 5px solid var(--coral); font-family: "Jua", sans-serif; color: var(--ink); line-height: 1.5;
}

/* 내 생각: 생각 예시 + 스스로 점검 */
.example-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--sun-tint); }
.example-box > b { font-family: "Jua", sans-serif; font-weight: 400; color: var(--sun); }
.example-item { margin-top: 8px; }
.example-item p { margin: 0; color: var(--ink); line-height: 1.7; }
.example-item span { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }
.check-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--leaf-tint); }
.check-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.check-head b { font-family: "Jua", sans-serif; font-weight: 400; color: var(--leaf); font-size: 1.05rem; }
.check-head .muted { font-size: .85rem; }
.check-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; line-height: 1.5; }
.check-item input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--leaf); }
.new-tag { font-style: normal; font-family: "Jua", sans-serif; font-size: .75rem; color: var(--leaf-tint); background: var(--leaf); padding: 1px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; align-self: center; }

.status-pending, .status-done {
  margin: 8px 0 2px; padding: 4px 10px; border-radius: 8px; display: inline-block;
  font-family: "Jua", sans-serif; font-size: .85rem; color: var(--rose); background: var(--rose-tint);
}
.status-done { color: var(--leaf); background: var(--leaf-tint); }

/* 지구온 입시사전 */
.dict-item { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--indigo-tint); }
.dict-item summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.dict-item summary small { font-family: "Jua", sans-serif; font-size: .82rem; color: var(--indigo); }
.dict-item summary::-webkit-details-marker { display: none; }
.dict-item summary b { font-family: "Jua", sans-serif; font-weight: 400; font-size: 1.12rem; color: var(--sky); }
.dict-item summary b::after { content: " ▾"; color: var(--muted); font-size: .85rem; }
.dict-item[open] summary b::after { content: " ▴"; }
.dict-item summary span { color: var(--ink-soft); font-size: .95rem; }
.dict-hint {
  align-self: flex-start; margin-top: 6px; font-style: normal; font-family: "Jua", sans-serif; font-size: .85rem;
  color: var(--indigo-tint); background: var(--indigo); padding: 3px 12px; border-radius: 999px;
}
.dict-hint::after { content: "👆 눌러서 자세한 설명 보기"; }
.dict-item[open] .dict-hint::after { content: "👆 다시 누르면 접혀요"; }
.dict-h { margin: 20px 0 4px; font-family: "Jua", sans-serif; font-weight: 400; font-size: 1.12rem; color: var(--ink); border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.dict-p { margin: 6px 0; line-height: 1.7; }
.dict-note { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--sun-tint); color: var(--ink); line-height: 1.6; font-size: .92rem; }
.dict-table-title { margin: 14px 0 6px; font-family: "Jua", sans-serif; color: var(--indigo); }
.dict-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dict-table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.5; background: var(--surface); }
.dict-table th, .dict-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.dict-table tr:first-child th { background: var(--indigo); color: var(--indigo-tint); font-weight: 400; font-family: "Jua", sans-serif; }
.dict-table tr + tr th { background: var(--surface-2); white-space: nowrap; }
.dict-faq { margin-top: 12px; padding: 10px 12px; background: var(--surface); border-radius: 10px; }
.dict-faq b { display: block; color: var(--indigo); margin-bottom: 2px; }
.todo ul { margin: 4px 0 0; padding-left: 1.2rem; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button {
  font-family: "Jua", sans-serif; font-size: .9rem; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); padding: 4px 14px; border-radius: 999px; cursor: pointer;
}
.filters button.on { background: var(--sky); color: #fff; border-color: var(--sky); }

.input-hint { margin: 6px 2px 0; font-size: .85rem; color: var(--muted); }

/* 이름 + 비밀번호 */
.login-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-top: 4px; }
.login-label { font-family: "Jua", sans-serif; color: var(--ink-soft); white-space: nowrap; }
#pinInput { letter-spacing: .4em; font-variant-numeric: tabular-nums; }
#nameMsg { font-size: .92rem; line-height: 1.6; }
#nameMsg:empty { display: none; }
.input-hint b { color: var(--ink-soft); }
.steps-list { margin: 12px 0 14px; padding-left: 1.3rem; color: var(--ink-soft); font-size: .95rem; }
.steps-list li { margin-bottom: 2px; }

/* 기록 옮기기 코드 */
.code-line { text-align: center; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.code-text, .code-box {
  font-family: "Jua", sans-serif; font-weight: 400; letter-spacing: .12em; color: var(--sky);
  font-variant-numeric: tabular-nums;
}
.code-text { font-size: 1.05rem; margin-left: 4px; }
.code-box {
  font-size: 1.7rem; text-align: center; background: var(--sky-tint);
  border-radius: 12px; padding: 10px; margin-top: 4px; user-select: all;
}
#codeInput { text-transform: uppercase; letter-spacing: .1em; }
#transferCard summary {
  font-family: "Jua", sans-serif; font-size: 1.15rem; cursor: pointer; list-style: none;
}
#transferCard summary::-webkit-details-marker { display: none; }
#transferCard summary::after { content: " ▾"; color: var(--muted); }
#transferCard[open] summary::after { content: " ▴"; }
#transferCard summary .muted { font-family: "Gowun Dodum", sans-serif; font-size: .85rem; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .hanja-big { font-size: 4rem; }
  .brand-name { font-size: 1.25rem; }
}

/* 지구 온 로고 (오른쪽) */
.side-logo { order: 3; width: 52px; height: 52px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 1px 4px rgba(38, 51, 59, .12); }
.topbar .nav { margin-left: auto; }
@media (max-width: 640px) {
  /* 휴대폰: 제목 줄 오른쪽 끝에 로고, 메뉴 버튼은 아랫줄로 */
  .side-logo { order: 2; margin-left: auto; width: 46px; height: 46px; }
  .topbar .nav { order: 3; width: 100%; margin-left: 0; }
}
